writing ascii data to pc (hyperterminal)

bagged2drag

Member
Join Date
Mar 2011
Location
Milwaukee
Posts
37
Hello, I am trying to send a keyboard command to a pc (press the letter "Y" followed by "Enter".

I am modifying existing code which just sends a carriage return when needed. I am using a L18ER-BB1B with a 1734-232ASC/C. When I set my output data to a Y and send the command, all the pc is registering is an enter command. I have tried with and without the carriage return, always getting the same result. I have opened notepad and confirmed this. If I check the output data of the 1734-232ASC/C, the correct data is in the data table (Y$r). The data length is correct I believe too. Any ideas what I can be doing wrong?

I have attached a snippet of code in an image. I threw a couple equ bits in a line just so I can see my current data.

logic.jpg
 
The 1734-232ASC can also be set up with a terminating character that is transmitted after every output transaction trigger. $R is the default.

I think you're only putting the "Y" into the output data table because you are using "NumInts" as the length of the COP, and that is calculated as (2+1)/2 = 1.5, which rounds down to 1 when the operands are integers.

Still, even if you only had the data length set for 1, the "Y" should be the byte that is transmitted.

So let's check the Delimiter configuration first, and then see the exact contents of the 1734-232ASC output tag.

ASC232_Config_Delimiters.PNG
 
The recieve data is set to ignore delimiter, termination mode include delimiter on receive data. Transmit data is set to include delimiter.

When testing, i did manipulate the length of the COP manually (set it to 1,2,3 and 4 chars) to see if that would work. I put the original logic back in place when that was unsuccessful. As I haven't done this with a plc before, I assumed it will be characters in string + 1 for the delimiter. With a robot I always use the actual number of characters if I recall (its been quite a number of years).

I will be hooking the plc up to a different computer just to test if I dont see anything.

My string data in the logic (outdata) had a value of 89 or 121 in position 0, $r in position 1. Oh, when looking at the data view for the card (local:2:O.data[0], the integer matched what I would have expected (89 or 121, depending on if I used caps or smaller case) when running the command.

What else I am not super familiar with is the sending event. I know its working as I can see the computer entry come through, but is the changing of the integer value in Local:2:O.TransmitRecordNumbers the event that triggers the write event to the rs232 card?


The 1734-232ASC can also be set up with a terminating character that is transmitted after every output transaction trigger. $R is the default.

I think you're only putting the "Y" into the output data table because you are using "NumInts" as the length of the COP, and that is calculated as (2+1)/2 = 1.5, which rounds down to 1 when the operands are integers.

Still, even if you only had the data length set for 1, the "Y" should be the byte that is transmitted.

So let's check the Delimiter configuration first, and then see the exact contents of the 1734-232ASC output tag.

config.jpg
 
I will get some shots of the actual card output data shortly.



The recieve data is set to ignore delimiter, termination mode include delimiter on receive data. Transmit data is set to include delimiter.

When testing, i did manipulate the length of the COP manually (set it to 1,2,3 and 4 chars) to see if that would work. I put the original logic back in place when that was unsuccessful. As I haven't done this with a plc before, I assumed it will be characters in string + 1 for the delimiter. With a robot I always use the actual number of characters if I recall (its been quite a number of years).

I will be hooking the plc up to a different computer just to test if I dont see anything.

My string data in the logic (outdata) had a value of 89 or 121 in position 0, $r in position 1. Oh, when looking at the data view for the card (local:2:O.data[0], the integer matched what I would have expected (89 or 121, depending on if I used caps or smaller case) when running the command.

What else I am not super familiar with is the sending event. I know its working as I can see the computer entry come through, but is the changing of the integer value in Local:2:O.TransmitRecordNumbers the event that triggers the write event to the rs232 card?
 
I solved the issue. Dummy me had a bit that would prevent data from being written until a process was complete. Well, cycling that bit also meant reading the original data. Ugh..

Thanks for the help though either way. It's appreciated.
 
Thanks for posting the resolution !

I would have to test to be sure, but in my recollection the automatically-added termination character is not included in the count of characters. If you want to send "Y<cr>" by using the automatic termination character, the length is 1.

You are correct that changing the integer value in the tag Local:2:O.TransmitRecordNumber is what causes the 232ASC to transmit its data.

I have one of those modules at my office and a 1734-AENT here at the home-office if you want to do more logic experimentation.
 
OT, but the world is so much better with CIP objects being more and more common for process devices.
 

Similar Topics

can any body send me the ladder diagram for sending and reading e.g N7:0 TO N7:5 from serial port of plc5/30 to a visual basic programme using mscomm.
Replies
1
Views
4,409
Hello All, Is there a way to send several ascii stings to a display using one AWT command? I am using one AWT for every error message, if there...
Replies
3
Views
1,952
Hi, I'm having an issue in crimson 3.0 when I create a programme using a case statement referencing a fault word that each bit needs to change the...
Replies
1
Views
75
Hello all, I'm currently working on a servo motor linear positioning system (ball screw). I'm all set up regarding communication between my HMI...
Replies
1
Views
80
Hello All: I have a Windows 10 PC running a FTView ME Station 10.00. I have a .mer file version 6.00. It has been running well on it for a long...
Replies
1
Views
156
Back
Top Bottom