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.

Write to CF Card when tcp/ip connection failed


macp May 28, 2013 02:09 PM

Hello

I have CR1000 datalogger with NL115 CF Card module (8GB).
I wont to store data to Compact Flash only when tcp/ip connection failed.
If tcp/ip connection between cr1000 and server(Logernet) is all right, I wont store date to CF.
How can I detect whether the connection between cr1000 and server(Logernet) is true or false.
It is only a backup of data that may be lost.

It would be great if you could clarify it.

Have anybody an idea?

Thanks!
Cyril


jtrauntvein May 28, 2013 04:56 PM

Provided that your datalogger is configured as a PakBus router (the "Is Router" setting in DevConfig or PakBus Graph is set to true - note that this is not the default), your CRBasic program can use the Route() instruction to determine the PakBus neighbour that will be used to reach the PakBus address specified by the argument (in your case, LoggerNet's PakBus address). If the datalogegr is configured as a router and the datalogger does not have a connection to to LoggerNet, the Route() will return a value of zero.


cyril May 28, 2013 06:26 PM

Interesting solution.
And what if my datalogger is not configured as a PakBus router.
I have no experience with PakBus network.
Thanks for reply.


jtrauntvein May 28, 2013 06:39 PM

If the data logger is not configured as a PakBus router, the Route() instruction will return the value of its argument. This negates its ability to help detect whether a PakBus/TCP connection exists.


cyril May 28, 2013 08:13 PM

Can I use other instruction to help detect TCP connection instead of Route() instruction.
Thanks for reply.


GaryTRoberts May 28, 2013 09:10 PM

You could use PingIP as well. Ping the LoggerNet server's IP address (if it is not behind a firewall). If it returns 0, start writing to the card.


jtrauntvein May 28, 2013 10:19 PM

As Gary writes above, the PingIp() instruction will test whether the host computer running LoggerNet can be reached via IP. It tells you nothing, however, about whether that machine has a running instance of LoggerNet that can accept connections and also tells you nothing about whether a PakBus/TCP connection already exists. For that, the Route() instruction is the only method that I know that works and then only when the data logger is configured to be a PakBus router.


cyril May 29, 2013 10:48 AM

Thank you for your answering,
I use the CardOut Instruction to send data to a CF card.
CardOut must be entered within each DataTable declaration.

DataTable(ST350,True,-1)
DataInterval(0,5,Sec,10)
If Route(4094)=0 Then CardOut(0,1000)
Average(1,Vr1000,IEEE4,False)
Average(1,Strain,IEEE4,False)
EndTable

CardOut cannot be used within a condtional statement and compile faild.

What should I do?

Thanks!
Cyril


jtrauntvein May 29, 2013 01:03 PM

The CardOut() instruction serves to extend the table memory to the card storage device. The datalogger makes valiant efforts to ensure that the table data stored on the card and the table data stored in memory are synchronised. As such, it makes no sense for the CardOut() instruction to be invoked conditionally. Further, the instructions allowed between a DataTable() and EndTable declaration are also limited since these serve to define the structure for that table.


cyril May 29, 2013 02:18 PM

Can I use instruction TableFile().
TableFile(FileName, Option, MaxFiles, NumRecs/ TimeIntoInterval, Interval, Units, OutStat, LastFileName)
Do you know other solution how to write data to NL115 CF Card module?
thanks

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