'CR1000 Series Data logger Program for Digiquartz Intelligent Sensors 'Program author: Paroscientific, Inc. 'Description: This code reads and stores pressure from Digiquartz Intelligent Products. 'The code has the P3 command to read pressure Public OutString as string * 100 Public InString as string * 100 Public Pressure as string * 100 'Define storage area in memory. Table name is Digiqrtz. DataTable (Digiqrtz,1,-1) DataInterval (0,10,Sec,10) Sample (1,Pressure,String) 'Store Pressure EndTable 'Main Program BeginProg 'Set up communication port to send and receive data SerialOpen (Com1,9600,0,0,10000) 'Uses COM1. Default 9600 baud rate. Change if instrument has different baud rate. Scan (10,Sec,0,0) 'Read data every 10 seconds. Change if needed. OutString = "*0100P3"+CHR(13)+CHR(10) 'Send Pressure string over one communication port C1 (COM1 TX). SerialOut (Com1,OutString,"",0,500) 'Receive String on port C2 (COM1 RX). SerialIn (Instring, Com1,500,10,100) 'Receive timeout is 5 secs. Change if needed. SplitStr (Pressure,InString,"*0001",1,4) 'Call Output Tables to store values CallTable Digiqrtz NextScan EndProg