LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hot to set all the values of FieldPoint hardware on the exit?

What is the best way to set all the values of FieldPoint hardware(input and output) to some default when I press exit button in a while loop?
0 Kudos
Message 1 of 9
(3,520 Views)
Perhaps I'm overlooking something obvious here, but in the interest of
contributing as well as soliciting help I'll take a crack...

It seems to me you have two simple choices; you can break the wire
between the stop button and the stop/continue node of the while loop
and insert a case structure which (in the true case) does the FP writes
you want and passes a true value to the stop node (outside of the case),
and in the false case just passes the wire from the button (or a false value)
to the stop node.

Alternatively, and perhaps more simply if the timing is OK, you can
pass something (any constant or variable will do) out of your loop on
completion which wires to a sequence structure containing the FP writes.
The passed variable need not *do* anything; it merely signals the structure
to execute, which it will do only as the while loop is exit'ed.

Bob Miller
0 Kudos
Message 2 of 9
(3,511 Views)
Thanks Bob.
Probably you are right, the best way is to create case loop which will write all the data I need on exit.
Thanks.
0 Kudos
Message 3 of 9
(3,508 Views)
The only problem with the case structure inside the loop is timing; if there is
something else in the loop which needs to complete before you write the fieldpoint
you need to manage that either by using the second alternative I proposed or
wiring a dummy variable out of the portion of the code which needs to execute first
to the case structure perimeter to hold off it's execution.

Fieldpoint hardware has a "watchdog" functionality which can put the hardware into
a MAX-configured default state when a timeout occurs. There may be some elegant way to
exploit this feature to do what you want without a raft of FP writes; I am not
informed enough about this feature to say definitively, but you might want to check
it out in the fieldpoint documentation and/or the help pages for the FP watchdog VIs
in the block diagram edit palette (Real Time VIs > Real-time Watchdog>*) The watchdog
was created to perform an action if something *doesn't* happen; it might be tricky to
get it to go off instantaneously when something *does* happen (exiting a loop).

On the other hand, if you can wait at least one while loop iteration time before the
fieldpoint must be put into your default, the watchdog is made-to-order for you -- you can
"whack the watchdog" every loop iteration to keep it from acting until the loop finishes.

Bob
0 Kudos
Message 4 of 9
(3,505 Views)
There are two watchdogs in the FieldPoint system. All FieldPoint network modules have a communications watchdog that will set selected (configured) outputs to the specified level in event of communication loss. Additionally, FieldPoint RT modules have an RT watchdog that is used to reset the module if the user code hangs and/or crashes. This watchdog will reboot the RT controller if the watchdog is not whacked within the specified time. It only works with embedded code running inside RT targets. When the FieldPoint module reboots, it will apply the specified power-up output levels to all channels.

The easiest way to set all output channels at the end/exit of a program is to write the desired values as an exit condition after the while loop exits, or as part of the exit case in a loop driven state machine.

Regards,
Aaron
LabVIEW Champion, CLA, CPI
Message 5 of 9
(3,494 Views)
Thanks Bob an Aaron.
I have seen the watchdog in a MAX. I have tried to understand how it work, but it seems without success.
I configured watchdog in MAX. Do I need to write some code in a LabView as well?
I have found some palette "FieldPoint Extended Optomux" that has a number of Watchdog VIs. Which one should I use.
Sorry for such a stupid question but I am not a programmer just a scientist.
Regards, Sergey.
PS: I will try to find some examples with watchdog in a FieldPoint board.
0 Kudos
Message 6 of 9
(3,485 Views)
Sergey,

I believe the "watchdog" VIs you found are the same as in the path I mentioned.
I noticed multiple paths when I traversed the palette to document a route for you.

However if as you say "you are a scientist, not a programmer", taking the route of
adding the case structure on loop exit is probably the easiest route for you, even
though it is, well, "programming" ;-). It is at least "easy" programming on the same
level of difficulty as the LabVIEW code you have already created.

I would attach a snippet of code illustrating the above technique, but the computer
I access this forum on is not the computer which has LabVIEW installed, so I have no
platform here to create the code.

Aaron is clearly the veteran here, so I will defer any further discussion of the
watchdog facilities (should you choose to pursue it) to him -- I have read about
these but not yet attempted to use them. All I would be doing is reading help
documentation and relaying it to you, probably in an inept way ;-)...

Regards,

Bob
Message 7 of 9
(3,470 Views)
Sergey,

What type of network module are you using?

In configuring the communications watchdogs, there are places in which you must enable the communications watchdog for it to take effect. In Measurement & Automation Explorer, under Devices and Interfaces (for serial network modules) or Remote Systems (for ethernet network modules), you should browse to the FieldPoint network module (e.g. FP-1000 @0 Bank). In the properties pane, you need to set the Network Watchdog COnfiguration to Enable For Bank. Note: FP-100X series modules have two network watchdogs (Current and Power-Up), while ethernet modules have only one, in either case set all watchdogs to either Enable or Enable for bank. Apply the setting to the module and then browse to each module that has output channels (e.g. FP-DO-400 @3) and select the Device Configuration tab in the bottom of the right-hand pane. Set the network watchdog to enable (this enables the watchdog for the selected module). Apply the change and switch to the Channel Configuration Tab. For each channel that you wish the watchdog to effect, set the Watchdog Value and select the Watchdog Value Enable box. When you are done with all modules, the network communications watchdog is configured.

If you have a serial network module, the watchdog is not enabled until the first read/write command is sent to a module attached to the network module. For ethernet modules, the watchdog is enabled when the first data item is subscribed to. Because the FieldPoint server automatically subscribes to all ethernet channels as long as MAX is open, the watchdog will be enabled immediately and will trigger when no active subscriptions remain or when the timeout period expires. Exiting MAX will close the FieldPoint server which will trigger the watchdog.

For the network communications watchdog, if you follow the instructions to properly configure the watchdog, you do not need to write any code in LabVIEW.

Regards,
Aaron
LabVIEW Champion, CLA, CPI
Message 8 of 9
(3,459 Views)
Thanks, Aaron,
Very good description. It is a nice news that it does not need additional code.
I already saw your comments about watchdog in a FieldPoint forum and already did what you have described.
Thanks.
Sergey.
0 Kudos
Message 9 of 9
(3,451 Views)