11-20-2009 02:22 AM
I am using LV8.5.1 (but I have also 2009).
Looking the MB Serial Init.vi (used in the NI Modbus "official" library), I think there is an error.
According to the standard ("Modbus over serial line specification and implementation guide V1.02.pdf"), page 12/44, about RTU transmission mode, quotes:
"Remark: the use of no parity requires 2 stop bits"
Inside the MB serial init.vi, if parity is set to "none" then stop bit shoulndn't be accordigly set to 2 ?
The NI function set it to 1.0 in any case.
thanks
good day
11-20-2009 08:08 AM
Yes, the manual does say that, and the MB Serial Init does set it to 1 stop bit no matter what.
I don't know if every device out there follows that specification for number of stop bits. I know I came across this situation before where the MB Serial Init was wrong, and since they didn't bother to put the # of Stop Bits as a selectable parameter on the connector panel, I just don't use it.
I'd recommend scrapping the MB Serial Init and use the basic VISA Configure Serial Port VI instead.
It would be good if NI revised the Modbus library to either take this into account, or just let the user configure the data bits, stop bits, and parity themselves. The RTU/ASCII mode input wouldn't even be needed on the MB Serial Init VI in this case.