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.

Ports & Flags


Hilltop Aug 28, 2011 09:14 PM

Are there any cora script commands for getting the state of a port or flag?

I have seen the toggle command for changing the state of a port or flag.

Also are we able to use any of the COM controls for creating our own software for displaying the Low Level Log(like the one found in Log Tool)


Sam Aug 28, 2011 11:29 PM

You could use the get-variable command with a PakBus logger

get-value cr1000.Public.MyFlag

If you have LoggerNet installed on a Windows machine you can find cora_cmd.pdf in C:\Program Files\Campbellsci\LoggerNet.


Hilltop Aug 28, 2011 11:55 PM

What about for mixed-array dataloggers?


Sam Aug 29, 2011 12:26 AM

http://www.campbellsci.com/documents/manuals/cr10x.pdf

Appendix C - Using J and K commands

You won't need cora command

I think you would send the logger

2413J[CR/RETURN]
K[CR/RETURN]

* Last updated by: Sam on 8/28/2011 @ 6:36 PM *


Hilltop Aug 29, 2011 02:39 AM

The Connect Screen software, what does it use to determine the state of a flag in the Ports and Flags window (changes the image colour to green, if true)?


Sam Aug 29, 2011 03:26 AM

It uses the data retrieved by the LoggerNet server. The Connect Screen is a client to the LoggerNet server.

The LoggerNet server retrieves data from the logger using the commands outlined in the CR10X manual, also referenced in the previous post. We often refer to them as J & K commands.

You can find out more information from

http://www.campbellsci.com/documents/manuals/cr10x.pdf

and

"Cora_cmd.pdf" located in C:\Program Files\Campbellsci\LoggerNet.

* Last updated by: Sam on 8/28/2011 @ 9:26 PM *


Hilltop Aug 29, 2011 04:23 AM

basically i'm trying to see how easy it would be to implement our own dialog (in our own software) for handling the Ports and Flags(working exactly as it does in the Connect Screen software).


jtrauntvein Aug 29, 2011 04:02 PM

The get-value command is currently supported only for table based dataloggers including the CR10X-PB and the CR10X-TD. You can, however, force the LoggerNet server to poll the ports_and_flags table using the selective-manual-poll command as follows:

selective-manual-poll <logger-name> ports_and_flags;

If you are using the LoggerNet SDK, you can then access the value using the CsiDataSource control. You can also access the values that were polled by using the data-query command:

data-query <logger-name> ports_and_flags 20110101 20111231;

This command requires a begin and end date but, since the table is generally only one record long, this will select anything that was stored this year.


Hilltop Aug 29, 2011 09:32 PM

To check for a programs public variables would they also be in the ports and flags table?

We will be using the following loggers
CR1000
CR800
CR200
CR10X pakbus


Hilltop Aug 29, 2011 10:22 PM

With these loggers,
- CR1000
- CR800
- CR200
- CR10X pakbus

do i get the ports status, flag status and public variables all from the public table?


jtrauntvein Aug 29, 2011 11:14 PM

The CR10X-PB, CR23X-PB, and CR510-PB will keep the ports and flags status information in variables that are so named in the "inlocs" table.

The CR1000, CR3000, and CR8XX dataloggers do not keep variables with "predefined" flags like the older dataloggers do. They allow your program to define boolean values either singly or in arrays. The ports and flags monitor in the LoggerNet connect screen will look for and monitor these values. These loggers will report the state of their control ports in the PortStatus array in the Status table. There is also a PortConfig array that specifies how each of the control ports have been configured.

To the best of my knowledge, the CR2XX does not explicity keep track of ports or flags so it would be up to you program to keep public variables up to date.


Hilltop Aug 30, 2011 12:06 AM

So with the CR200, your CRBasic program would have variables that would hold the state of a port? Which would then be available in the public table.

At the top of page 141 http://www.campbellsci.com/documents/manuals/cr200.pdf

it shows a declaration for a Port(8) variable.

* Last updated by: Hilltop on 8/29/2011 @ 6:25 PM *


Hilltop Aug 30, 2011 02:40 AM

With the CR10X using packbus, does this then use the public table or does it still use the inloc table?

With the CR10X packbus can we still use the get-variable and set-variable commands?


jtrauntvein Aug 30, 2011 01:18 PM

The CR10X-PB has an "inlocs" table rather than a "public" table. It maintains fields in these tables to keep the state of both ports and flags. The get-value and set-value commands will work with any variable in the CR10X-PB inlocs table.

The page to which you refer is the page in the CR200 manual that describes the ModBus functionality in the datalogger.


Sam Aug 30, 2011 07:27 PM

With Jon's help -

In summary, with your network properly configured in LoggerNet, you can force set/get data using Cora Command

------

CR10X-PB:

'get first three ports
get-values myCR10XPB.inlocs.ports --swath=3

'get first three flags
get-values myCR10XPB.inlocs.flags --swath=3

'set flag 1
set-value myCR10XPB.inlocs.flags(1) -1;

------

CR1000:

public Flag(5) as boolean
beginprog
scan (5,Sec,0,0)
nextscan
endprog

'get eight ports
get-values myCR1000.Status.PortStatus --swath=8

'get flags
get-values myCR1000.Public.Flag --swath=5

'set flag 1
set-value myCR1000.public.flag(1) -1;


------

CR200(x):

Public Port(2)
Public Flag(2)
BeginProg
Scan (1,Sec)
PortGet (Flag(1),C1)
PortGet (Flag(2),C2)
NextScan
EndProg


'get ports
get-values myCR200.Public.Port --swath=2

'get flags
get-values myCR200.Public.Flag --swath=2

'set flag 1
set-value myCR200.public.flag(1) -1;

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