LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Troubleshooting intermittent problems

Michael,

In your Sample program changing the Mechanical Action on the buttons to Latch when Released (or Latch when Pressed) eliminates the need for the property nodes to reset the switches.

The examples which come with LV are at File >> New.. >> VI >> From Templates >> Frameworks >> Design Patterns.

Blocked acquisition: If you have multiple instruments on one GPIB bus, you have the possibility of conflicts. Use timeouts to limit how long you wait for a response. If you use a single VI to do the GPIB reads and writes and call it from various places for the different instruments, you can avoid having one try to read just after the other wrote. I think this may have been where Albert was suggesting the use of an Action Engine.

One way to avoid having a state machine lock up in a time consuming state is to move the really time consuming part to a parallel loop and send commands and data between the two loops via queues. For example suppose it takes two seconds to change the magnet current. Then in the Change Magnet state send "Change Current to X" command via the command queue and set a Waiting for Magnet Change flag. Next state is still Change Magnet. If the event structure has sent a new command ("Lunch Break"), then the state machine can respond immediately to that. Otherwise it returns to the Change Magnet state where it checks the Wait flag and the response queue to see if the change has finished. It can repeat this state many times and then go on to the next state after the change is complete. It may only spend microseconds in the state before checking the event command queue, but seconds or hours before it goes to some other state.

Lynn
0 Kudos
Message 11 of 12
(467 Views)
Lynn,

Thanks for the tips.  Those make sense, and I'll see about implementing them.  I've been debating rewriting the code, since it does mostly work, but it would be satisfying to (a) fix this bug, (b) implement a new-to-me design, and (c) have cleaner, more maintainable code.  I appreciate your help.

Michael
0 Kudos
Message 12 of 12
(445 Views)