Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Conditional program/table execution


Anton May 18, 2010 03:10 PM

My CRBasic program has multiple tables, some of which collect continuously, but others I would like on demand only.

I can choose to have data collected only when certain conditions hold true. Is there any way to set a variable from a remote computer via loggernet in order to gain manual control over when data is collected? Or is there another way to do this?

Thanks!


jra May 18, 2010 08:25 PM

Anton,

Something like the below program snip would work. You can toggle the Boolean variable from LoggerNet's Ports & Flags screen, or through the Numeric Display, or under program control.

public StoreDataFlag as boolean
DataTable (ConditionalTable,StoreDataFlag,100)
Sample (1,counter,Long)
EndTable

When storing data conditionally be sure to allocate a specific number of records in the size parameter of the DataTable instruction. Take a look at this tutorial: http://www.campbellsci.com/19_1_9999_153

Regards,
Janet

* Last updated by: Janet on 5/18/2010 @ 2:25 PM *


Anton May 19, 2010 07:36 PM

Thank you. I never would have guessed you could modify values on the numeric display - I'll have to be careful with that!

Anton


IslandMan May 20, 2010 10:11 AM

Anton,

If you don't want them seen on the numeric display use "Dim" instead of "Public" to define the variable.

IslandMan


Anton May 20, 2010 06:00 PM

It's good to be made aware of this. I think I should break the habit of just declaring everything as public.

Anton


kirving May 20, 2010 06:15 PM

Some other things to note about public variables... They display in order on the keypad unit, I think 7 to a 'page', so it can be useful to declare them with that in mind. The keypad display has a limited width, so shorter variable names may help keep things readable.


Anton May 25, 2010 03:17 AM

Thanks for that advice as well!

Anton

Log in or register to post/reply in the forum.