Hi i have an application using studio 5000 to a serial device. The serial device is sending an Ascii string. First question what is the best way to send the data through the HMS and secondly I can recieve data into plc via sint or Dint but when i try to send data to the serial device I am not getting any information just zeros
Hi @RogerB,
Are you using the HMS-EN2SE-R?
The best way to send the data through the HMS will depend on what the serial device supports. I would recommend using Master Mode and Query/Response if the device supports it. Do you have the documentation for the serial commands and data?
It may be that you are just reading the wrong registers, again we would need to determine this by the serial device documentation. Can you share it along with your Anybus configuration file?
Kyle
Hi Kyle
Yes using 3 x HMS-EN2SE-R into a Compactlogix PLC
I have attached the I/O we are looking at extracting from the serial device and sending to serial device .
The Manufacturers and software owners of serial device are able to set up the serial end how we want but it will be an Ascii String.
With the send data to the serial device is the HMS set to master mode and then a hand shake of set bit send data and then receive an acknowledge bit back
Regards Roger
You can do either Master Mode or Generic Data mode. With Master, the serial device would be a slave device that you would send a query to and receive a response back, so it has to be able to be set up this way. It can update cyclically, on data change, with a trigger, etc. With Generic, you can use basic Produce and Consume tags and even just consume a stream of data.
Take a look at the Transactions section in the User Manual for more details.
Hi Kyle
Following on from your advice attached is the Serial device protocol plus a correction to what I communicated to you .
“Just a note about your reply to Kyle. You mention you get ‘just zeros’. This is not true, the serial device receives one byte of 0xFF for every message you try and send”
Regards Roger
Cw012CokeProtocol.doc (37 KB)
OK this is helpful and let’s us see the format that will be used for the transactions. Did they give you the actual commands you are going to need to use to access the data you need? Those can be sent directly from the Anybus (serial master side) I assume. If we have those commands, using this format from the Protocol sheet they provided, we can build the necessary transactions:
I would also want to confirm the Checksum setting to use (this is from our manual):
So our settings would look something like this:
Do you have a config file started that you can share?
Kyle
Hi Kyle
First of all thank you for you help and patience!
The following is from the Software guys
Also attached is config file.
Is it possible you can show me a transaction set up
Regards Roger
Hi Roger,
The data you need to receive can all be gathered using the ‘R1’ command. You will need to send the R1 command and the device will respond with the ‘R1’ response containing all the data.
The data you need to send, which will be less frequent, can all be sent using the ‘W1’ command. You will need to send the W1 command containing all the data and the device will respond with the ‘R1’ success/fail response.
Does this give you enough to build the necessary transactions?
Roger Broughton
Director
BR Automation & Engineering Services Ltd
+44 7393982384
Checkweigher Config.cfg (16 KB)
Hi Roger,
So your transactions are going to look something like this:
The Byte Constant is the node or slave address (STN):
The word constant is your command (CMD):
The VariableDataObject is your data:
Then the Checksum (CS) (not sure if this is correct):
and the Carriage Return (CR):
I"m a little unsure about the data to send command. Do you know what data it is sending? Is this variable data that needs to be sent from the PLC?
Kyle
Topic closed due to inactivity.