How to send a String over a serial output channel?

iPadr

Member
Join Date
Oct 2022
Location
UK
Posts
4
Hello,

I have a scanner connected to my Allen Bradley PLC and i can receive the scanned barcode in my plc as a String.
Now i need to transfer this barcode to a device which can only accept a usb connection.
IT blocked the Eth to USB adapter, so i had to find an alternative way to communicate with that device, so i ordered a Serial Module and add to Compact guardlogix plc and managed to configure it.
Would you please help me to find a way to transfer the barcode to the other device through the serial module using the serial to usb cable?

Shall i transfer the string to ASCII? How?
If so, would the device receive it as an original barcode text or in ascii translation?
How to test the output before connecting to the device?

Thank you
 
Serial to USB adapters are typically designed to work with a PC (host) which has the appropriate Windows driver to emulate a serial port. I have not seen one work the other way around, where it is connected to a device rather than a host PC.

What is the device with the USB port?
 
What about python. ?
Use pylogix to get code from PLC, and then use python to send same code to an USB port.
I have never done it, buy it seems feasible.
Wait for Dustin (Dmroeder) he is the one.
 
What is the device with the USB port?
^ This.
We know diddly about the device that should be receiving the string, and without that it would be difficult to suggest a solution (although I like the pylogix idea, except that it requires a third device).

Is the device running Windows, Windows CE, Linux, Arduino, summat else? What control does OP have over how it operates and what programming is possible with a USB/Serial cable?
 
Hello, sorry for the late reply.


the topology works like that
SICK Scanner > Compact Guardlogix PLC > Operations PC (Linux)


i cannot send the scanned barcode directly to the PC as we need the barcode to be entered if it's a keyboard input


it could be done using an Eth to USB adapter but the IT blocked that usage as it may breach some of their policies.


anyway, the other option i thought , as we have the barcode in the PLC anyway, let's transmit it to the PC,using a Serial to USB converter and the barcode to be received as a text input on the PC
so, added the Serial module to the PLC, configured it as stated in the Rockwell guide.


i managed to transfer the barcode String into ASCII but i still cannot receive the text on the PC
do i miss something?

2023-06-01_14h41_13.png
 
Last edited:
Operations PC (Linux)
And suddenly this started making sense. LOL

Did the PC accept the USB converter?

You can just link the pins 2 and 3 of the serial cable to test whether it's sending data or use the USB converter in your laptop with a serial port program like Putty or the Arduino IDE.

On Linux you may need to do something to the device and also link it to the right "file". HAve you tried the converter from the PC as well? With minicom or something similar?
 
The second rung is for display, correct?

What is the Local:8: device? Please post a link to the manual.

Have you read the manual?

So it looks like

  • the PLC is an Allen-Bradley Compact- or ControlLogix
  • you are expecting that CPS instruction to send data to the serial port of the Local:8: device,
  • which data should be read by the Linux device, to which the USB-Serial cable is attached,
  • and the device name on the Linux side is /tty/ttyUSB0 or similar
    • Have you verified the device name in /var/log/syslog or /dev/tty*?
What are the target communication parameters (baudrate, data bits, parity, stop bits, flow control, echo, line termination, etc.)?

And what are the actual communication parameters on either end cf. sudo stty -F /dev/ttyUSB0 -a on the Linux side; a configuration menu on the Logix side.
 
Was a solution found for this application?

I'm working on something similar: barcode scanner to PLC, which will process the data, to thermal inkjet printer (running on Windows 7).
 
If your IT doesn't have an issue with all network comms, then another option is to use a socket server and open socket connection to get your ASCII across to the PC. OT having to hack methods to get around IT policy is usually a good indication that IT doesn't have an adequate understanding of the organisation.
 

Similar Topics

So I had an odd request from a customer for the above. I have written the logic and tested it all in one PLC with only using 7 outputs and 7...
Replies
15
Views
427
Hello Everyone, I want to send a string from AB PLC to ABB robot control. I can send integers from PLC to abb robot using group input but not...
Replies
4
Views
2,345
I am trying to send data from my Guardlogix 1756-L72S to a Leibinger JET3 UP PI Printer trough a MSG instruction, I can send information if the...
Replies
10
Views
4,199
Hi All, I am currently developing an application using a L18ER PLC and a JET 3 printer. The printer prints a 2D UV bar code onto bottles passing...
Replies
3
Views
3,463
Hi folks, I am using Vijeo Designer V6.0 to send ASCII string commands to printer. The printer is an inkjet printer that prints on boxes. I have...
Replies
0
Views
4,186
Back
Top Bottom