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.

how can i log kern balance rs232 with cr1000


mortenx Apr 26, 2017 05:13 PM

kern balance output from rs232 port  is weight , interval 1 sec, and i want to log with cr1000 logger..

where can i get sample programm or something like that or what sensor i must use in shortcut?


mortenx Apr 27, 2017 09:57 AM

i got it almost to work ,

i think my problem is formating input string ..

lets say input string is 4 digit number (like 2345)  then  cr1000 saves it also 4 digit number (2345) when interval is 1 sec.

but if i change scan interval 1 min. then cr 1000 saves it as 3 digit number (345) 3 last digits from the input string

balance output format is in page 27 http://www.kern-sohn.com/manuals/files/English/CB-BA-e-0640.pdf

BBBBBBBBB0,0BgBBCRLF

B-blank

and i want to save only number before comma

'Declare Variables and Units
Public SerialInput As String *16
Public SerialFields(1) As Float
Public weight As Float

Units weight=g

'Define Data Tables
	DataTable(Table1,True,-1)

	Sample(1,weight,Float)

EndTable

'Main Program
BeginProg
	' Initialize Serial Port
	SerialOpen(Com4,9600,0,0,100)
	'Main Scan
	Scan(1,Sec,1,0)
		 SerialIn(SerialInput,Com4,6,&h0D,16)

If InStr(2,SerialInput,"",0) Then 
			'Separate input into fields
			SplitStr(SerialFields(),SerialInput," ",1,0)
	
			weight=SerialFields(1)
			'Store weight as floating point number
			EndIf
	
		'Call Data Tables and Store Data
		CallTable Table1
		'send data to serial out
   SerialOpen(Com2,9600,16,0,10000)
         SerialFlush(com2)
      SerialOut(Com2,weight,1,0,100)
   
	NextScan
EndProg

 

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