LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to wait for holding register to be changed using NI Modbus Library

I'm using Labview Modbus Library downloaded from : http://www.ni.com/example/29756/en/

 

I have PLC Siemens S7-1200 communicating with Labview using holding registers. Each of holding registers represents a signal. That Labview reads of writes into PLC.

 

When trying to call class VIs from NI Teststand it reports an error that VIs should be called ass Class Members and that dynamic dispatching is not allowed...

 

If I want to wait for specific holding registers inside of a PLC I have to write a Labview vi (while loop and inside of it a function that reads holding register). 

Is there any other VI of a way to use class members function that waits for holding register for a specific period of time?

 

 

0 Kudos
Message 1 of 3
(907 Views)

Nope. polling the register and checking for changes and having a timeout so you can move on if it doesn't change really is all you can do.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 3
(851 Views)

I wouldn't make a sequence step VI that polls and checks a register, unless it's only used once for that one TS step.

 

You probably have a sequence that interfaces with the device a lot. So I'd start a VI at the start of the sequence, that continuously communicates with the device. This 'modbus broker' would not stop until the sequence stops (or continuous even after that, for the next sequence).

 

The TS steps would communicate with the broker, but on a different level. These steps will be simple. All heavy lifting will be done in the broker.

 

Where the responsibility of the broker ends is up to you. You can make a complete device abstraction, so the steps get events, and use enums for the device specific parameters, or stop at the modbus level, or anything in between.

 

Starting and stopping modbus communication every time a step needs it is a bad idea, IMHO.

 

As a bonus, the broker would be able to catch alarms, warnings and errors, even when no step is active.

 

And additional bonus would be that you can do a lot more realistic testing in LabVIEW. Once the broker and the steps work in LabVIEW, they should work in TS too. With the pragmatic approach, you'd actually need to develop a test in LabVIEW to simulate how TS behaves.

0 Kudos
Message 3 of 3
(820 Views)