Chwastowski Posted February 7, 2020 Report Posted February 7, 2020 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 kratmel Posted February 7, 2020 MVP 2023 Report Posted February 7, 2020 One quastion: Is it in V700 installed card for port2? Note: V700 has only Port1 onboard and if USB is connected port 1 is disabled.
Chwastowski Posted February 7, 2020 Author Report Posted February 7, 2020 Yes, Port 2 has the proper module, I forgot to include that in the description.
MVP 2023 kratmel Posted February 7, 2020 MVP 2023 Report Posted February 7, 2020 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.
Chwastowski Posted February 7, 2020 Author Report Posted February 7, 2020 In info mode, the message being sent is being received, I will get back regarding the checksum calculation Monday. Thank You for the direction.
Chwastowski Posted February 11, 2020 Author Report Posted February 11, 2020 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
Chwastowski Posted February 11, 2020 Author Report Posted February 11, 2020 Also for the example message, 7B 4D is the beginning of the 24 byte packet, 0F is the checksum second last, and 7D the the end of packet.
MVP 2023 kratmel Posted February 11, 2020 MVP 2023 Report Posted February 11, 2020 I try to correct your code, please check MI4,MI5.......vector in simulation mode It is working part of my project on pic. 232Test_KR.vlp
MVP 2023 Ausman Posted February 11, 2020 MVP 2023 Report Posted February 11, 2020 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now