LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU Not working from Labview

Hi,

 

I am attaching a VI, version Labview 2024Q3. I have used Modbus master library, from plasmionique. It is not functioning, but we are able to communicate the VFD drive from Modscan 64 application.

 

I have tried NI Modbus library also but in vain. It does not popping any errors when sending command to start/stop drive or even setting the frequency.

 

Appreciate any help.

 

Thanks.

 

0 Kudos
Message 1 of 4
(548 Views)

Have you tried a third-party GUI-based Modbus toolkit like QModBus?

https://github.com/ZhiYang-Ong
0 Kudos
Message 2 of 4
(487 Views)

I just ran your test VI and picked up what the Modbus RTU commands it spits out look like. Initializing VISA first, then doing a StartDrive outputs this Modbus RTU command:

 

01060AFA047CA902

 

Decoding it we get:

 

Hex Byte(s) Field Value (Hex) Value (Dec) Meaning
01 Slave Address 0x01 1 Target device ID
06 Function Code 0x06 6 Write Single Holding Register
0AFA Register Address 0x0AFA 2810 The specific register being written to
047C Register Value 0x047C 1148 The raw value to write into that register
A902 CRC Checksum 0x02A9 — Verification payload (Little-Endian)

 

Which is a valid command.

 

If you try to do the same in ModScan 64 and log the traffic does the command look any different? Can you post the setup of ModScan64 when it is working (perhaps a minor detail in the serial port or address setup explains it..).

 

Try looking at the error output of the Open Serial Session, perhaps something is preventing it from initializing the port properly on your system (VISA does sometime dislike some USB to serial drivers e.g.), does it produce any error?

 

If there is no error from the open session or write VI, can you hook up a laptop using a null-modem or use a loopback and a serial tool to read the data coming from the port when running the LabVIEW test VI, what binary output do you see, something different than what I did?

0 Kudos
Message 3 of 4
(353 Views)

Are you sure your device is configured to use Modbus slave address 1? VFD seems to use as default address 1 but maybe someone tinkered with the device. Modscan 64 may use a slave address scan routine when starting up to find any device located at address 1 to 99 or similar.

 

With the wrong slave address you will not receive any error from any of the LabVIEW Modbus libraries (except possibility a timeout error which is by some of the libraries suppressed) because technically there is no error, you just shout into the void "Mark please answer me!" but with no Mark present you simply get no answer.

 

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 4
(333 Views)