NI Labs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

NI LabVIEW Modbus API Discussion

Not that I'm aware of...this module is more or less discontinued, and I doubt it has support for everything the modbus libarary uses:

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209852

0 Kudos
Message 311 of 529
(1,451 Views)

Hi,

Thanks for your reply, I managed to find the cause of the problem, it was a bad solder connection on a connector (for the modbus), Re-soldered and error has disappeared. So it seems it was an intermittent/broken line for TX or RX (I'll have to check the wiring diagram for which)

Message 312 of 529
(1,452 Views)

MBAP Header?

In re-writing my master stuff from the old library, I have one device that refused to talk on ModbusTCP unless the Unit ID was set to 1 (I think the maker slapped a ModbusTCP - Serial gateway on what was traditionally a serial only device). The unit ID was set on the old library blocks using the input called 'MBAP Header'

I see a FB in the new API called 'Set Unit ID' Which sounds like what I need.

However, the help file for the Set Unit ID block in the new API says this...

This function only applies when using the RTU or ASCII serial transmission data unit. The TCP/IP transmission data unit ignores the unit ID.

Which gives me pause.

Should I be worried?

0 Kudos
Message 313 of 529
(1,451 Views)

No, don't be worried. Remember modbus is not a particularly standardized standard. It should say that modbus TCP devices   ignore the unit id unless the slave device is a TCP to serial gateway (in which case the id is forwarded along) or if the manufacturer decided not to ignore it (in which case the most common requirement is that unit id is 1).

0 Kudos
Message 314 of 529
(1,451 Views)

Hi smithd,

Is it possible to interface to PLC using Modbus API? Most of PLC supports Modbus protocol.

Please reply ASAP

thanks

Regards

sun143

0 Kudos
Message 315 of 529
(1,452 Views)

HI sun143, yes it's possible to interface with PLC (Programmable Automation Controllers)

https://decibel.ni.com/content/docs/DOC-30140

Luc

,

banniere Luc Livre NXG Champion.png

Luc Desruelle | Mon profil | Mon blog LabVIEW | Auteur livre LabVIEW : Programmation et applications - G Web
Certified LabVIEW Architect (CLA) & Certified TestStand Developper (CTD) | LabVIEW Champion

MESULOG - LinkedIn site | NERYS - NERYS Group
| directeur CEO MESULOG
| CODIR - NERYS group

0 Kudos
Message 316 of 529
(1,452 Views)

Hi all,

Daneil, thank you very much for such a great API. So far its been very helpul.

I have gone through the posts but can't figure out one common problem. How to use the slave connection and read the values. Or may be I am quite tired to find anything of my use.

A bit backgroud,

I am using energy meters which are based on modbus,

the configuration is that one device is master which is connected with the PC via ethernet.
--> This device is working, checked with the company software and then succussfully tested with the API in LV by using the "New TCP Master" vi. I can read the values which is what I wanted on the relevant addresses.


There is a slave device which is connected to the master device via RS-485 and hence the Master device let us call it 100 is acting as the gateway for the slave at address 201.

--> I have tested from the software of the company and I can see that the slave device is connected and it is working properly.

Important points,
When I am testing this connection in the software I have to select the option called "Modbus-RTU (ethernet encapsulated)" and the port it is using is 8000 not 502 which was the case for the master.
In case of the master the option i have select is "Modbus TCP".

In LV whenever I am opening a new slave device either with port 502 or 8000. I am not getting any error. Also when I read the values on any specific address it does not show any error but it does not show any value either.

In short, what I want to know is;
How can I use the slave vis from the API to get the values of a device which is connected with a gateway(TCP master) via RS-485 who has the address 201.

Thanks in advance.

Regards,
Naqqash

Naqqash
Message 317 of 529
(1,452 Views)

Hi

I'm successfully using the MODBUS API library. I have one question regarding MODBUS slave (TCP/IP and serial RTU):

In my application, the slave device only supports 100 input and 100 holding registers. When the 3rd part master application tryes to read or write to any MODBUS register outside the supportet register range, an MODBUS exception "Illegal data address" should be sent back to the master.

I have so far not found the magic part where I can modify the number of registers supported. Can somebody pelase help?

Thank you

Best regards

Reto

0 Kudos
Message 318 of 529
(1,452 Views)

see that it is possible to communicate with this APP an application in PC to a PLC via Modbus protocol, my question is whether esposible also send and receive messages with a variable speed motor Rockwell PowerFlex 4M

0 Kudos
Message 319 of 529
(1,452 Views)

CarlosOtiniano wrote:

see that it is possible to communicate with this APP an application in PC to a PLC via Modbus protocol, my question is whether esposible also send and receive messages with a variable speed motor Rockwell PowerFlex 4M

If the power Flex drive can be configured to talk ModbusTCP, or Modbus serial, then yes.

0 Kudos
Message 320 of 529
(1,452 Views)