L
Hi!
I'm writing a HMI program to link a PLC and a PC. Using mscomm control in VB I can send a character to PLC and wait to receive a character sent back from the PLC. I entered "a" in a textbox and sent it to PLC which programmed to sent "c" when receive "a". It works.
Now I want to send data from 2 textboxes to the PLC. The protocol used is MODBUS RTU. I wonder if I have to merge the data from the 2 textboxes before change the new data into binary number and send it?
I can write a program to produce the CRC code correlative to a definite code entered. I dont know how to make the program be able to produce CRC code automatically which is correlative to the different data entered from the 2 textboxes?
Would you please show me the way to write a procedure to sent data from PC to PLC and versus, and how to write a procedure to create the CRC code according to the data from the 2 textboxes.
Thank you very much
Luan Nguyen
[email protected]
I'm writing a HMI program to link a PLC and a PC. Using mscomm control in VB I can send a character to PLC and wait to receive a character sent back from the PLC. I entered "a" in a textbox and sent it to PLC which programmed to sent "c" when receive "a". It works.
Now I want to send data from 2 textboxes to the PLC. The protocol used is MODBUS RTU. I wonder if I have to merge the data from the 2 textboxes before change the new data into binary number and send it?
I can write a program to produce the CRC code correlative to a definite code entered. I dont know how to make the program be able to produce CRC code automatically which is correlative to the different data entered from the 2 textboxes?
Would you please show me the way to write a procedure to sent data from PC to PLC and versus, and how to write a procedure to create the CRC code according to the data from the 2 textboxes.
Thank you very much
Luan Nguyen
[email protected]