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.

GetVariables with Pakbus


Zipwize Jan 14, 2010 09:31 PM

I'm trying to develop a program that reads variables and arrays from a remote CR800. I have a base (router) CR800. There will be 10 remote CR800's connected with RF401's.

I see the format:
GetVariables ( ResultCode, ComPort, NeighborAddr, PakBusAddr, Security, TimeOut, "TableName", "FieldName", Variable, Swath )

1. Can someone show an example of this using the CSI/O port to the RF401 for a PakBus address of "1168", and get the panel temperature of the CR800? (There is not enough explaination on the "TableName", "FieldName" parameters.

2. What are the ComSDC7,ComSDC8,ComSDC10,ComSDC11, and why isn't there a ComSDC9? (I saw this in the help file for Get Variables).

3. I want to use an SC12 cable from the CSIO/Port of the RF401 to the CSI/O port on the CR800. What is the name of the CSI/O port? There are too many CSI/O options to figure out.


ChipsNSalsa Jan 14, 2010 11:16 PM

Example program:

'Declare variables
Public RXResponse
Public CR800PTemp

'Main program
BeginProg
Scan (1,Sec,0,0)
If TimeIntoInterval(0,5,Min) Then
GetVariables(RXResponse,ComSDC7,0,1168,0000,0,"Public","PTemp",CR800PTemp,1)
EndIf
NextScan
EndProg

Most of our peripheral devices that can be connected to the CS I/O port of a datalogger support Synchronous Device Communication (SDC). The default SDC address of the RF401 is 7 that's why I used it in the example above. SDC address 9 is only used when there's a mixed array datalogger attached to the peripheral device. Modem Enable (ComME option) could be used but SDC communications is more robust. So to direct communications to an RF401 attached to the CS I/O port use ComSDC7 (prefered) or ComME.


Dana Jan 16, 2010 02:07 PM

To add to what Chips says regarding question 1, TableName is the name of the data table in the remote datalogger where the variable is stored that you are trying to "get". The variable can be from the Public table, Status table, or a data table.

The fieldname is the name of the variable in the remote datalogger that you are trying to get.

If you have LoggerNet 4.0, try laying out your network using the Network Planner, which is new for this version. It was specifically designed to help set up dataloggers in PakBus networks so that they can communicate with each other and the LoggerNet server. The network planner will create all the configuration files for all the devices in your network, and then you can send a configuration to each device. It makes seting up the physical part of the the PakBus network much easier.

Regards,

Dana W.


Zipwize Jan 16, 2010 04:32 PM

I was able to get this to work. Thanks for your help

If TimeIntoInterval(0,1,Sec) Then
GetVariables(RXResponse,ComSDC7,0,1158,0000,0,"Public","Panel_Temp",CR800PTemp,1)
GetVariables(RXResponse,ComSDC7,0,1158,0000,0,"Public","Battery_Volts",CR800Volts,1)
GetVariables(RXResponse,ComSDC7,0,1158,0000,0,"Public","EventSample1",CR800Event1,1)
GetVariables(RXResponse,ComSDC7,0,1158,0000,0,"Public","Eventsample2",CR800Event2,1)
EndIf

I was also able to reset my remote event counts.

'Call Data Tables and Store Data
CallTable(Table1)
CallTable(Table2)

If TimeIntoInterval(0,45,Sec) Then
CR800Event1 = 0
CR800Event2 = 0
SendVariables(RXResponse,ComSDC7,0,1158,0000,0,"Public","Eventsample1",CR800Event1,1)
SendVariables(RXResponse,ComSDC7,0,1158,0000,0,"Public","Eventsample2",CR800Event2,1)
EndIf

In the remote loggers if the analog exceeds a threshold, the Eventsample increments so base station will know. The system works better than I thought.

Thank you


Hidrologiamiel Nov 14, 2012 03:27 PM

We have a network of CR850 connected trought RF310M and trying to get variable of an remote cr850, like this:

ComPort
RFBase_Td (PB = 0)
RF_Trasvase (PB = 36)
CR_850_Trasvase (PB = 36)

RF_Repeter (PB = 38)
CR_1000_Repeter (PB = 38)

RF_Ecologico (PB = 35)
CR_850_Ecologico (PB = 35)

The connection between RFBase_TD and CR_850_Ecologico, CR_850_Trasvase is made trough CR_1000_Repeter, because there´s no line of sight. We have line of sight between CR_850_Ecologico and CR_850_Trasvase.

On CR_850_Trasvase we need to get variable "Q_AVG" of table_10m from CR_850_Ecologico; the sintaxis maybe is the next:

GetVariables (RXRESPONSE,ComME,0,35,0000,0,"Datos10m","Q_AVG",Ecologico,1)

Ask: The variable is going trough the repeter to RFBase_TD and then to CR_850_Trasvase or is going directly from CR_850_Ecologico to CR_850_Trasvase.

Would you to help us?

* Last updated by: Hidrologiamiel on 11/14/2012 @ 9:11 AM *


jtrauntvein Nov 14, 2012 04:41 PM

The RF-TD network does not support station to station communication. If you configure LoggerNet so that its PakBus ports are bridged, LoggerNet will be able to forward packets from one station to another. You may experience a significant delay, however, because the packet sent from the client datalogger will not be transmitted over RF until the RF base or the RF repeater polls the modem for data. This means that your instruction is going to have to wait at least as long as the RF polling interval for its response.


Hidrologiamiel Nov 14, 2012 04:55 PM

We have active the option "Value Forwared" on LoggerNet but the delay or missing packets are a big problem when the weather is bad or the Repeater fails.

Does exist another way to get the variable directly from the station?

Thanks.

* Last updated by: Hidrologiamiel on 11/14/2012 @ 9:55 AM *

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