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.

SDM SIO1A - probe vaisala GMP251


Benoit BURBAN Jul 22, 2019 05:50 AM

 Hi, i've got communication problem with CO2 probe from Vaisala (GMP251).

I put address with an hyperterminal, after I put all probe in poll mode with a form for output data like this : form 3.1 “,” CO2 "," tcomp "," pcomp "," o2comp "," rhcomp "," #r #n

With loggernet software I can check output with terminal but there’s nothing with the program.

I can't send you screenshot with forum but i send you the program.

thank you for your help.

'CR1000 Series Datalogger
'To create a different opening program template, type in new
'instructions and select Template | Save as Default Template
'date:
'program author:

'Declare Constants
'Example:
'CONST PI = 3.141592654 or Const PI = 4*ATN(1)

'Declare Public Variables
'Example:
Public PTemp, batt_volt
Public co2(3), 
Public tcomp(3),
Public pcomp(3),
Public o2comp(3),
Public rhcomp(3)

Public NBytesReturned,i
Public SerialIndest(3) As String * 145
Public stringcom(3) As String
Public resultvar(5)

Units batt_volt=Volts
Units PTemp=Deg C
Units  co2=ppm
Units  tcomp = Deg C
Units  pcomp=hPa
Units  o2comp=%
Units  rhcomp=%

'Declare Other Variables
'Example:
'Dim Counter

'definition du port utilise par le SDM SIO1 ( pour reglage 0 sur commutateur rotatif)
Const Gmp251PORT=32
Const CRLF=CHR(13)+CHR(10)'caracteres retour chariot nouvelle ligne

Sub acquisitionGmp251
  
  SerialOpen (32,19200,48,0,100)
  'configuration  19200  et 51 pour 19200 N 8 1
  For i = 1 To 3
    'Interrogation capteur i et attente debut reponse capteur (caracteres RH)
    SerialOut (32,stringcom(i),CRLF,3,100)
    'on demande les datas
    Delay (0,500,mSec)'Recuperation data du capteur i sur port serie dans chaine SerialIndest(i)
    SerialInRecord(32,SerialIndest(i),00,25,CRLF,NBytesReturned,00)
    'on recupere la ligne rs485 
    SplitStr(resultvar(), SerialIndest(i),",",5,4)  'on decoupage
    'Affectation informations 
    SerialFlush (32)

    co2(i)=resultvar(1)
tcomp(i)=resultvar(2)
pcomp(i)=resultvar(3)
o2comp(i)=resultvar(4)
rhcomp(i)=resultvar(5)
  Next i
  SerialClose (Gmp251PORT)
EndSub

'Define Data Tables.
DataTable(CO2_1min,True,-1)
DataInterval(0,1,Min,10)

	Average(3,co2(),IEEE4,False)
  Average(3,o2comp(),IEEE4,False)
  Average(3,pcomp(),IEEE4,False)
  Average(3,rhcomp(),IEEE4,False)
  Average(3,tcomp(),IEEE4,False)
  Average (1,PTemp,FP2,False)
  Average (1,batt_volt,FP2,False)
EndTable

'Define Subroutines
'Sub
	'EnterSub instructions here
'EndSub

'Main Program
BeginProg
	'initialisation des commande send adresse + retour chariot
  stringcom(1)= "SEND 1"+CRLF
  stringcom(2) ="SEND 2"+CRLF
  stringcom(3)= "SEND 3"+CRLF
  'stringcom(4)= "SEND 4"+CRLF
  'stringcom(5)= "SEND 5"+CRLF
  'stringcom(6)= "SEND 6"+CRLF
 Scan (30,Sec,30,0)
acquisitionGmp251   'appel fonction GMP251

CallTable (CO2_1min)
	NextScan
EndProg

 


kris33000 Jul 26, 2019 03:29 AM

I work with campbelll product since 10 years and I think there is a bug between Serialin instruction with cr1000 an SIO1A

Serialin or Serialinrecord or serialinblock doesn't work with cr1000 and SIOA and SENSOR VAISSALA GMP251 with rs485.

When I run my prog
I watch my string with the terminal in loggernet  option W com 32
exemple

T : SEND 1\r\n
R:,790,27.8,*****, 21.0, 50.0,\r\n


T : SEND 2\r\n
R:,780,27.8,*****, 22.0, 50.0,\r\n

T : SEND 3\r\n
R:,782,27.8,*****, 23.0, 50.0,\r\n

and my prog is :
'CR1000 Series Datalogger
'To create a different opening program template, type in new 'instructions and select Template | Save as Default Template 'date:
'program author:
'Declare Constants
'Example:
'CONST PI = 3.141592654 or Const PI = 4*ATN(1)
'Declare Public Variables 'Example:
Public PTemp, batt_volt Public co2(3),
Public tcomp(3), Public pcomp(3), Public o2comp(3), Public rhcomp(3)
Public NBytesReturned,i
Public SerialIndest(3) As String * 145 Public stringcom(3) As String
Public resultvar(5)
Units batt_volt=Volts Units PTemp=Deg C Units co2=ppm
Units tcomp = Deg C Units pcomp=hPa Units o2comp=% Units rhcomp=%
'Declare Other Variables 'Example:
'Dim Counter
'definition du port utilise par le SDM SIO1 ( pour reglage 0 sur commutateur rotatif) Const Gmp251PORT=32
Const CRLF=CHR(13)+CHR(10)'caracteres retour chariot nouvelle ligne
Sub acquisitionGmp251
SerialOpen (32,19200,48,0,100) 'configuration 19200 et 51 pour 19200 N 8 1 For i = 1 To 3
'Interrogation capteur i et attente debut reponse capteur (caracteres RH)
SerialOut (32,stringcom(i),CRLF,3,100)
'on demande les datas
Delay (0,500,mSec)'Recuperation data du capteur i sur port serie dans chaine SerialIndest(i) SerialInRecord(32,SerialIndest(i),00,25,CRLF,NBytesReturned,00)
'on recupere la ligne rs485
SplitStr(resultvar(), SerialIndest(i),",",5,4) 'on decoupage 'Affectation informations
SerialFlush (32)

co2(i)=resultvar(1) tcomp(i)=resultvar(2) pcomp(i)=resultvar(3) o2comp(i)=resultvar(4) rhcomp(i)=resultvar(5)
Next i
SerialClose (Gmp251PORT) EndSub
'Define Data Tables. DataTable(CO2_1min,True,-1) DataInterval(0,1,Min,10)
Average(3,co2(),IEEE4,False) Average(3,o2comp(),IEEE4,False) Average(3,pcomp(),IEEE4,False) Average(3,rhcomp(),IEEE4,False) Average(3,tcomp(),IEEE4,False) Average (1,PTemp,FP2,False) Average (1,batt_volt,FP2,False)
EndTable
'Define Subroutines 'Sub
'EnterSub instructions here 'EndSub

'Main Program BeginProg
'initialisation des commande send adresse + retour chariot stringcom(1)= "SEND 1"+CRLF
stringcom(2) ="SEND 2"+CRLF
stringcom(3)= "SEND 3"+CRLF
'stringcom(4)= "SEND 4"+CRLF 'stringcom(5)= "SEND 5"+CRLF 'stringcom(6)= "SEND 6"+CRLF
Scan (10,Sec,30,0)
acquisitionGmp251 'appel fonction GMP251
CallTable (CO2_1min) NextScan
EndProg

I 've a same configuration with old os ont my cr1000 and my module rs 485 is a SIO and with vaissala sensor hmp155 and i have no problem.
the trame are similar.
Thank you for your answer


aps Aug 2, 2019 04:46 AM

I believe the issue you are seeing maybe because your logger is running in pipeline mode.  When it does this several of the serial instructions are run in a different way by the logger.   This method of operation was introduced to support applications run by scientists making flux measurements where they need all their measurements tightly synchronised.  When in this mode Serialinrecord(s) is actually run at the top of the scan, no matter where called in the program.   This can all get very confusing especially if you try flush the serial buffer from the program too.

To make the logger follow a more logical timeline, unless you need very tight time synchronisation to the start of the scan, include the command "Sequentialmode" near the top of the program.

This mode of operation is detailed somewhere in the depths of the help system, but I will request this is emphasised more clearly.


aps Aug 2, 2019 04:59 AM

One other tip: in the first program listed above the same instance of Serialinrecord is called in a loop.   This often does not work well due to the way the logger maintains the memory buffer for serialinrecord.

Please either avoid doing this or refer to the CRBasic help.   Later operating systems for the logger include options for different memory pointers.

For this type of application with multiple outputs and inputs it  is often best to stick with SerialOut/SerialIn instructions.


Benoit BURBAN Aug 5, 2019 10:57 AM

We have already tried to use the command "sequentialmode" and we also try "serial out/ serial in" but it's' not running.

Can you send a example of program ? Maybe we made a mistake.


aps Aug 6, 2019 10:01 AM

I don't have a specific example for the GMP251, but I have on other suggestion.

In the Serialinrecord in the instruction you have entered the endword effectively as a string.   (CRLF which is formed by appending two characters)   The logger can be a bit fussy about the end word format so I would try entering this as a number, as described in the manual, i.e. ,&H0D0A

Please give that a try.

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