Campbell Hausfeld SDM-SIO4 manual Ibn8Ficn8F

Page 20

SDM-SIO4 User Guide

i[ ] Scan until any ASCII characters entered between the brackets are encountered. The maximum number of characters between the brackets is 255. Note that this filter does not remove the matched character from the buffer.

nn Discard ‘n’ bytes. ‘n’ can be in the range of 0-255.

Nn Read ‘n’ bytes. ‘n’ can be in the range of 0-255 (not converted to Campbell Scientific floating point).

pn Hexadecimal byte should be here, n=number of bytes to convert (n=1 to 3 hex pairs) to Campbell Scientific floating point.

rn Send the byte received to port ‘n’ for re-transmission. ‘n’ can be 1-4. The byte is removed from the receive buffer.

s Stop the filter until commanded by the datalogger to restart.

t[ ] Search for an exact string match between the [ ]. All ASCII characters up to and including the matching string are removed from the receive buffer before the next filter type starts.

T[ ] Search for an exact string match between the [ ]. All ASCII characters up to the matching string are removed from the receive buffer before the next filter type starts. (Same as t[ ], except matching strings are not removed).

u[ ] Convert ASCII floating point into Campbell Scientific floating point format until the termination character/string between [ ] is seen. The termination character is removed from the buffer.

vn[ ] Convert ‘n’ ASCII hex pairs into Campbell Scientific floating point format until the termination character/string between [ ] is seen. ‘n’ can be 1-3. The termination character/string is removed from the buffer.

wn[ ] Convert ‘n’-byte binary data into Campbell Scientific floating point format until the termination character/string between [ ] is seen. ‘n’ can be 1-3. The termination character/string is removed from the buffer.

x This marks the start of a data set. A data set is a set of converted data for the datalogger to collect. When this filter type is used the data in the data set is only available to the datalogger when all parts of the data set have been converted – see ‘X’, below.

X This marks the end of a data set. This makes the data converted in the data set available to the datalogger. This also means that data after this is available to the datalogger as soon as the SDM-SIO4 has converted each value. If the end of the data set is at the end of the filter string then this filter is not required as the end of the filter string is always the end of a data set.

z Flush the UART FIFO (serial port hardware buffer) and the Receive buffer associated with the port that is using this filter type. This does not, however, clear the converted data buffer.

As an example, take the following sensor output string:

battery 12.65V,current 12mA

The filter string might be:

i[b]n8Fi[c]n8F

Output to the datalogger would be 12.65 and 12 as Campbell Scientific floating point numbers. This filter string works as follows:

1. i[b] waits for the trigger character ‘b’ of ‘battery’.

3-4

Image 20
Contents Issued Page Guarantee Page Contents Data Error Detection Appendix A. Ascii TableWhat is the SDM-SIO4? IntroductionDatalogger Command Control Specifications SDM-SIO4 Serial Port Pin ConfigurationSerial Ports Serial Port BuffersPower Requirements SDM PortCase Environmental Operating RangeOther Key Features Page Installation and Hardware Set-Up Setting the SDM AddressAddress Settings Selector Block Settings SDM AddressTransient Protection and Grounding Selecting RS232 or 5V Logic for Each PortConnections to the SDM-SIO4 No. of Flashes Description of error/status Power-on Tests the Status LEDStatus LED Error Codes Page Method of Entering Special / Control Characters Understanding How the SDM-SIO4 Handles DataIntroduction Simple Filters Input FiltersFilter Types Filter Strings Ibn8Ficn8F Output Formatting Simple Output FormatterPredefined Filter Strings Filter No Filter String UsedOutput Format Strings Fmtst 123 z261 f62 iBattery z257 f61z273 CR10X Program ExampleGet battery voltage Get panel temperatureProgramming the SDM-SIO4 Command Line Operation and StructureEntering Commands Basic Commands Advanced Commands Errorres Hexdump start address number of bytesBytewr address byte WD n Wderr n Wdaddr nTestio test# Testio returnsPage Programming the Datalogger Instruction 113 ParametersCommands and Options Parameters 4, 5 Parameter 7 Values per RepParameter 8 Starting Input Location Parameters 9 and 10 Multiplier and OffsetCommand 1 Poll of Available Data Understanding Parameter Options and Returned ValuesCommand 2 Signatures Command 3 Flush all Receive BuffersCommand 4 Send Data to Datalogger Command 5 StatusCommand 6 Flush Transmit Buffer Command 7 Activate Command LineCommand 8 Poll Tx Buffers for Data Command 9 Flush Converted Data BufferCommand 67 Get Return Code Command 320 Send Byte Data to SDM-SIO4Command 321 Execute Command Line Command Program Example for P113 CommandExecute the command line string Command 1024 Send String to Device Command 1025 Transmit a ByteCommand 1026 Serial Port Status First Value ReturnedFirst Command Option Reset Error Counters Second Value ReturnedThird Value Returned Fourth Value ReturnedCommand 1027 ‘Manual’ Handshake Mode Command 2049 Set Communications ParametersFirst Command Option Parameter Second Command Option ParameterCommand 2054 Set Up Receive Filter String Number or Character Code Example CR10X Program SDM-SIO4 Configuration ExamplesCommand 2305 Transmit Bytes Get two floating point numbers into locations 1 End of serial and filter setupSet flag one high so the above will only be done once Example CR10X Program Using Instruction P113 Command Strst 101 Send DataJMSet up the filter and then send string Wait long enough for sensor to send dataSensors Which Send Data Out Without Prompting Get data from SDM-SIO4 and put into locations 1Time stamp Instantaneous sample form the sensorExample CR10X Program without Polling or Interrupts Fltst 200 tdataA5xffExample CR10X Program using the Polling Method End of set upGet the two floating point values from the SDM-SIO4 Instantaneous values stored to final storageSet up string filter Delay required by filter set-up commandDo filter set-up only if flag one is clear Set flag one high so the filter set-up is only done onceInstantaneous value stored into final storage Example CR10X Program using InterruptsGet voltages into locations 3 and 4 if poll was true Set control port 8 to i/p so it can be used as an interrupt Do filter setup only if flag one is clearDelay required by filter setup command Interrupt routine for control port Get voltages into locations 3Instantaneous readings stored into final storage End of interrupt routineOutputting Datalogger Data Return Error Codes Flushing the Input and Output BuffersReceived Data Data Error DetectionError Detection with the SDM-SIO4 SDM-SIO4 User Guide Fltst 100 TFrequency=xg2n10fCCG8 Example of Using Received Data Filters2 CR10X Program Example Tell the SDM-SIO4 to use filter string Minimum delay of 4ms is required by the above P113End of filter setup End of get data Transmitted Data CRC32Example of Using Transmitted Data Filters Fmtst 100 g1i123456789G8Alternative CR10X Program Fmtst 100 g1 Fmtst 101 isome data Fmtst 102 f62 G8Use formatter string 100 to set up the CRC16 on port Minimum delay of 1ms is required after this commandMinimum delay of 3.8ms is required after this command Send the Ascii characters ‘Y’ and ‘Z’ to portCRC16-CCITT-IBM Data Error Detection Page Appendix A. Ascii Table Dec CharPage Appendix B. Serial Port Data Transfer Modes Baud ratesStop Bits Data LengthParity Bits Serial Handshake Modes