LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sanity check on re-entrancy

Hello all

 

I'm at the point where I can't see the wood for the trees again on this one...

 

I am creating an experimental flow test system which should be able to run four tests simultaneously and independently. I have structured my code so that I have the status of each test always visible, but the control buttons for that test will only be visible if the test station is selected (clicked). My top level VI has a UI loop, 4 button monitoring loops, a "station selected" monitoring loop and then 4 loops each containing the test state machine VI which is wired to a different test satation constant. Each test state machine should initialise on start up and sit "Waiting for start", the start is triggered by the button monitoring loops through a "Running flags" VI (making the global variables local).

 

I have made the test state machine VIs re-entrant, there are only the four instances of these in the code. Many of the sub VIs running under the test state machine are also pre-allocated re-entrant, but the Hardware controller is non-reentrant as there is only one set of hardware.

 

This set up does not work as I intended - there does seem to be sharing of data across the instances e.g. starting station 3 then station 4 can cause station 3 to stop, if station 1 is running then starting any other station will cause the station 1 display data to disappear (call to UI Reset station) and so on. Despite this being repeatable, I don't seem to be able to trace the problem using the debugger.

 

I guess there will be multiple issues in the code, but I would appreciate comments on the solution architecture and my use of re-entrant functions. It looks like the only solution at the moment (with this code) is to make each test state machine VI independent.

 

The top level VI is User Interface.vi. Thanks for any help

 

Ray

0 Kudos
Message 1 of 4
(2,290 Views)

Good Afternoon Ray,

 

It certainly sounds like your reentrantcy configuration could be causing this 'unexpected behaviour'.

 

If you check all of the Sub-VIs to ensure there are none set to non re-entrant execution this will enable us to rule this out for a start.

 

If you have any further relevant information to add please do so and we will try to find a solution.

 

 

 

 

Jamie Jones
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(2,252 Views)

Hello Jamie

 

Thanks for the reply. I have found the problem(s). I double checked the re-entrancy settings and there was one that was incorrect. I also found a problem with cross wired shift registers in my test configuration VI, which was causing the data to swap between stations - hence the strange behaviour. Fortunately my understanding of rentrancy was correct and I should be able to get the system working as designed.

 

Thanks

 

Ray

0 Kudos
Message 3 of 4
(2,225 Views)

I am pleased my suggestion helped you resolve the issue and that your application is now functioning as expected.

 

Regards,

Jamie Jones
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,195 Views)