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.

CS110 SerialOut() how to?


Turo Jun 26, 2017 06:42 AM

We have CS110 on site and we'd like it to send the electric field measurement to the RS232 port after every measurement. It could send the other measurements also, it wouldn't hurt. Here's the program:

const Mpp = 85
const Site_Corr = 0.114 
const Mcorrected = Mpp*Site_Corr 

Public panel_temp
Public internal_RH
Public battery_volt
Public E_field
Public leakage_cur
Public status
Public OutString As String * 100 

DataTable(Tab1,1,-1) 
DataInterval(0,60,sec,10)           
Average (1,panel_temp,ieee4,0)  
Average (1,internal_RH,ieee4,0)

Average (1,battery_volt,ieee4,0)

Average(1,E_field,ieee4,0)
StdDev (1,E_field,ieee4,0)
Average (1,leakage_cur,ieee4,0)
Maximum (1,status,ieee4,0,False)
EndTable

BeginProg
SerialOpen(ComRS232,9600,0,0,10000)

Scan(5,sec,0,0)
PanelTemp (panel_temp,250)
CS110(E_field,leakage_cur,status,_50Hz,Mcorrected,0)

'If the table has output, get the latest record
If Tab1.Output(1,1) Then
GetRecord (OutString,Tab1,1)

SerialOut (ComRS232,OutString,"",0,100) 'Send it out the serial port (ComPort,OutString,WaitString,NumberTries,TimeOut)
Endif

CallTable Tab1
NextScan
EndProg

When compiled from win7 cmd promt with cr1comp.exe says "CS110rs232ver2.cr1 -- Compiled in SequentialMode" but when sent to the CS110 via PC200w there's an error and no error code or number or anything.

Can you please help me? 

Regards Turo Salminen


Turo Jun 26, 2017 12:19 PM

I now think the problem could be that my cr1000 is Std.07 DATE:051130 and i downloaded and installed the latest PC200W


JDavis Jun 26, 2017 02:24 PM

If you update the CS110 operating system, it should resolve that issue.

You can get the OS on the CR1000 product page:

https://www.campbellsci.com/cr1000

Here is the video tutorial about how to update the OS:

https://www.campbellsci.com/videos?video=76


Turo Jun 27, 2017 06:47 AM

Thank you.

I did get the OS updated and it resolved some issues with devconfig.

But now when i send the above program with PC200W i get an error:

line 28: Undeclared variable OutString$.

Is it even possible that i load the program from the logger with PC200W then edit it with Notepad++ and send it back to the logger. Because that is what i've done here.

Thank you


Turo Jun 28, 2017 05:51 AM

Hello, i wrote the code below with notepad, not Notepad++, sent it to Cr1000 with devConfig and listened the rs232 with Putty and it works now. I think the problem was somehow the memory being run out.

const Mcorrected=9.69 'Mpp=85 * Site_Corr=0.114
DIM E_field, leakage_cur, status
DIM outstring As String * 30

DataTable(OneMin,-1,-1)
DataInterval(0,60,sec,10)
Average(1,E_field,ieee4,0)
Average(1,leakage_cur,FP2,0)
Maximum(1,status,FP2,0,False)
EndTable

BeginProg
SerialOpen(ComRS232,115200,0,0,1000)

Scan(1,sec,0,0)
CS110(E_Field,leakage_cur,status,_50Hz,Mcorrected,0)

If OneMin.Output(1,1) Then
GetRecord(outstring,OneMin,1)
SerialOut(ComRS232,outstring,"",0,100)

Endif
CallTable OneMin
NextScan

EndProg

Putty:"2017-06-28 07:43:00",-38.10734

-Turo

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