From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus ASCII software protocol with 8 data bits

Hi All,

I must communicate (serial) with a Handheld 3016 device (a particle counter from LightHouse). It uses Modbus ASCII software protocol with 8 data bits.

Every Modbus ASCII software protocol, I have been looking through use 7 data bits.

Any kind of Modbus LabVIEW libraries (old one like nimodbus.llb or new one like ni_lib_modbus_library-1.1.5.38.vip) let the chose to “tag” RTU (8 data bits) or ASCII (7 data bits).

*** There is nowhere ASCII with 8 data bits ***

I always get a kind of “framing error”... obviously since I can't set the com ok...

Any advices??

Thanks a lot for any help

Vids65

0 Kudos
Message 1 of 5
(5,251 Views)

Vids65,

 

Can you post the documentation you have from LightHouse on the communication protocol? 

0 Kudos
Message 2 of 5
(5,241 Views)

Wayne,

Thanks indeed for answering 🙂

Have a look at the document attached, page 111, appendix C.

It looks like a very standard Modbus setting except the Data Bits numbers... :?

Have a good day

 

0 Kudos
Message 3 of 5
(5,224 Views)

Vids65,

 

You've run into a problem that I've seen before.  The COMM settings in table C-1 of the manual do not meet the MODBUS specification.  ASCII should always use 7 bit.  In the event that no-parity is used with ASCII mode 2 stop bits will be sent.  This is unfortunately a common occurance.  Even the LV Modbus .lib has the stop bit setting wrong.

 

A couple of ideas:

  • Write your own version of MB Serial Init.vi that allows you to experiment with other settings.  Start with 7 data bits and   2 stop bits.
  • Fire up the factory software for the instrument and use an O-scope to watch the data packets.  Not an option for everyone but one that I use all the time.

 

 

 

 

 

 

 

0 Kudos
Message 4 of 5
(5,215 Views)

Wayne,

Again many thanks for answering.

Fire up the factory software for the instrument is already done Smiley Very Happy

Following your ideas (and the understanding you brought me about the ASCII Modbus mode), I'm experimenting other setting “playing” around with data, parity, stop, etc bits in order to make my own MB set. Eventually, if no success I'd use an O-scope to watch the data packets.

Cheers

0 Kudos
Message 5 of 5
(5,209 Views)