getting a string from modbus Protocol using VB


Thread Starter


My PC tool is VB. I want to receive a data string from theta Controls BTC-9800 PID controller. I tried MSComm in VB. we are using RS-485 to Rs232 coverter for communication between controller & PC Following are the settings of comport private sub Form_Load() MSComm1.comport= 1 MSComm1.settings= "2400,n,8,1" (same settings as for the modbus protocol) MSComm1.InputLen = 0 MSComm1.PortOpen = TRUE End Sub on timer event I send the ascii value of address of controller . the address of controller is set to "1" Now I want to check that after addressing the controller it shall give me some response string. so how can i write the code in VB for this communication? Since i don't want to control any operation of that controller and just want to retrieve the string after a constant period, i will be happy if you explain how to retrieve only the string from the controller
I guess if I were you, I would begin by assuring myself that I could talk to the controller using standard Modbus protocol. Have you tried to communicate with the controller outside of VB? Do you know that your converter is working? If you haven't established the items above, I might suggest that you go out to the Win-tech website ( I think?) and download Modscan. This is a very nice tool that you can use to test comms between your PC and the controller. Just a thought.
try setting rthresholdto say 10 and in timer check if the inbuffercount is >=10 afte say 2 sec.
i dont know if it will work, can also try to set rthresh.. to 1 to get oncommafter every single char.

i have a question "can u tell me how do i run the modem scripts thru the dialer i have made using vb