NI Labs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

NI LabVIEW Modbus API Discussion

Feature suggestion. I fixed the orginal issue I posted about (sorry for long delay) it was a deeply underlying OS issue.

The feature suggestion I had is on the slave server I'm assuming internally there is a semaphore managed constant data thought a  Pre-allocated clone reentrant execution VI (or this is how I've seen modbus slaves done in the past).

That being said. Is there a ways where I can control this semaphore for opperations where I want a thread to force exclusivity to a the data model for several opperations, as currently if I make 3 calls within a thread, I should allocate, release, allocate, release, allocate release. And the state I'm modifying may change between my operations.

I think that makes sense. I haven't finished my coffeee yet.

0 Kudos
Message 231 of 529
(1,239 Views)

Glad to hear its working.

I think I understand. The slave uses 4x DVRs to maintain a lock on the data (DVRs basically include semaphores). However because the semaphore + data access is integrated in this, there is no way to make a single request span multiple VI calls. That is, there is no way to replace "read reg 1", "read reg 2" with "lock", "read reg 1 + 2", "unlock". The only solution would be to get access to those DVRs directly at which point you could directly manipulate the dataset yourself, without using the APIs to do so.

I've been thinking about doing this off and on (for a different reason) so it may be something I get around to adding in the next few weeks if I find some time.

0 Kudos
Message 232 of 529
(1,239 Views)

Currently using version 1.1.4.33 (is that the most recent?).

On a serial holding registers read I get an Error 56, LabVIEW:  The network operation exceeded the user-specified or system time limit.

Should I get this for a serial read? Is it a general timeout error?

0 Kudos
Message 233 of 529
(1,239 Views)

the visa errors are weird and not very familiar so any timeout gets converted to 56.

the current version is 1.1.5, which is linked from the top of the download page.

0 Kudos
Message 234 of 529
(1,239 Views)

Upgraded to 1.1.5.39 error still remains.

Also why don't you just return the visa error unchanged?

0 Kudos
Message 235 of 529
(1,239 Views)

Also this is at least the 4th major project haulting error I've had with this library.

0 Kudos
Message 236 of 529
(1,239 Views)

The visa error isn't really meaningful most of the time because of the way modbus serial works. Basically there is always a timeout even if there isn't a timeout.

On the last page you had this same error with the newer version of the library. Now on this page you are back to an older version of the library and encountering the timeout again.

Questions:

Is this the same project? Different? What is the hardware? When do you recieve the timeout--is it immediate, or only occasional? Where does the timeout occur, on the master or slave? What is the master, what is the slave? If you retry after you get the timeout, what happens? Have you tried setting a longer timeout?

0 Kudos
Message 237 of 529
(1,239 Views)

I'm simply writing a new modbus RTU master library.

Not being able to dive into the source and quickly solve these problems has become unacceptable for my needs.

0 Kudos
Message 238 of 529
(1,239 Views)

OK. If you just need the master I'd start with this: http://www.ni.com/example/29756/en/

0 Kudos
Message 239 of 529
(1,239 Views)

Hi,

A couple of questions:

  1. Would it be possible to have an optional input, of the class type on the constructor i.e., on the polymorphic <Create Modbus Instance.vi>? This way users would be able to sub-class the master to wrap up device specific behaviour.
  2. Is there any reason for the locked block diagrams? It certainly helps when debugging to be able to look inside.

Thanks,

Steve.

0 Kudos
Message 240 of 529
(1,238 Views)