Jump to content

Recommended Posts

Posted

I am currently trying to receive a Hex as ASCII message from an instrument over RS232 on a V700. Currently to simulate I have been sending the expected messages over serial, but in the future the data will be constantly streaming. The Index of Received from the Scan Protocol keeps giving me a -1, indicating an invalid message and I can't seem to understand why. Anything should help at this point. 

The measurement packet contains 24 bytes, 2 bytes for the beginning, 1 byte for the checksum, and 1 byte for the end of packet, as indicated by the instrument and reflected in the Scan Protocol.

232Test.vlp

  • MVP 2023
Posted

Please go to the V700 info mode, then choose SERIAL and MONITORING. Select PORT2 

You can see what is sended from the computer to the panel RX buffer. If you see in panel RX correct message - you have wrong checksum calculated. Try another one from list.

Posted

So I now know that the checksum is calculated correctly, however I still am unable to receive/store the message as I expect. It feels as if buffer is just constantly being reset instead of storing the message being received. How can I move forward?

Here is an example of the type of message I am expecting to be receiving:

7B 4D 18 00 05 71 47 42 03 BC 4D 46 E0 AB F4 41 00 00 00 00 0F 7D

I have been sending this to COM 2 to no avail.

232Test.vlp

  • MVP 2023
Posted

Kratmel has just replied whilst I'm writing this!

I've had a quick look at the program and one glaring error is rung 2 where you have MB2 shown as a coil, it should be an inverted contact .  There are other things that are a waste of space with what is shown.  MB1 is not really necessary the way you have things running.  I get the impression that PLC logic is new to you and perhaps a bit of research into how the different elements work would not go astray.  The help files will cover all of this learning curve.

The other thing to remember is that even though the system may say that serial actions are finished, I always allow at least a few scans for the buffer to fully clear.   You may run into issues if you don't do this.  A simple counter loop incrementing on each scan that runs after the system says it is finished is the easy way to set this up, where it resets to 0 once reaching the number that consistently supplies good serial operations. The 0 reset is also the trigger to do another serial action.

Anyway, have a look at Kratmel's efforts.

cheers, Aus

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.