Campbell Hausfeld manual SDM-SIO4 User Guide

Page 58

SDM-SIO4 User Guide

3CRC16-CCITT-IBM (Tag Receiver).

4CRC32 standard.

Polynomial x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1.

5CSI Signature (see Appendix C of the CR10X Manual).

6Checksum using modulo 256.

7Checksum using modulo 8192 (See Section 5 of the CR10X Manual).

8-255 For future use.

Gn

This filter type can be added to the filter string to mark the end of the string and the point where the sensor signature should be. It also sets the data type to use. When this filter is done, the signature returned from the sensor will be converted into a standard data type, so the SDM-SIO4 can compare the original signature it calculated to the one the sensor returned. If the two signatures match, then the data is ready for the datalogger to collect, but if they do not match, the data will be removed, as it will be considered to be corrupt data (if no other data is ready for the datalogger to collect then -99999 for floating point or 255 for single-byte characters will be stored into the datalogger input location).

From the programmers point of view, the datalogger could be set up to do one of the following:

1.Poll the SDM-SIO4 to see if data is available.

2.Read the corrupt values as -99999 or 255 into locations and just store them as normal.

3.Read the values, check to see if they are -99999 or 255, and if so then ask the device connected to the SDM-SIO4 to re-send the data. Note that the removal of corrupt data in this way will only work if the Data Set filters are used.

Since Gn is always at the end of a data set, the data will always remain available for collection by the datalogger unless you define another data set with the ‘x’ filter.

n can be in the range of 0-255 which is the data type to use.

The data types that the SDM-SIO4 can deal with are as follows:

0No data type or check

18-bit binary. Expects 1 byte

216-bit binary least significant byte first. Expects 2 bytes

316-bit binary most significant byte first. Expects 2 bytes

432-bit binary least significant byte first. Expects 4 bytes

532-bit binary most significant byte first. Expects 4 bytes

6ASCII decimal. Waits until non ASCII 0-9 received

78-bit ASCII hex. Expects 2 ASCII bytes, if not 0-9,a-f,A-F then fail

816-bit ASCII hex. Expects 4 ASCII bytes, if not 0-9,a-f,A-F then fail

932-bit ASCII hex. Expects 8 ASCII bytes, if not 0-9,a-f,A-F then fail 10-255 for future use.

6-2

Image 58
Contents Issued Page Guarantee Page Contents Data Error Detection Appendix A. Ascii TableWhat is the SDM-SIO4? IntroductionDatalogger Command Control Serial Ports SpecificationsSDM-SIO4 Serial Port Pin Configuration Serial Port BuffersCase Power RequirementsSDM Port Environmental Operating RangeOther Key Features Page Address Settings Installation and Hardware Set-UpSetting the SDM Address Selector Block Settings SDM AddressConnections to the SDM-SIO4 Selecting RS232 or 5V Logic for Each PortTransient Protection and Grounding Status LED Error Codes Power-on Tests the Status LEDNo. of Flashes Description of error/status Page Introduction Understanding How the SDM-SIO4 Handles DataMethod of Entering Special / Control Characters Filter Types Input FiltersSimple Filters Filter Strings Ibn8Ficn8F Predefined Filter Strings Output FormattingSimple Output Formatter Filter No Filter String UsedOutput Format Strings Fmtst 123 z261 f62 iBattery z257 f61z273 CR10X Program ExampleGet battery voltage Get panel temperatureEntering Commands Command Line Operation and StructureProgramming the SDM-SIO4 Basic Commands Advanced Commands Bytewr address byte ErrorresHexdump start address number of bytes WD n Wderr n Wdaddr nTestio test# Testio returnsPage Programming the Datalogger Instruction 113 ParametersParameter 8 Starting Input Location Commands and Options Parameters 4, 5Parameter 7 Values per Rep Parameters 9 and 10 Multiplier and OffsetCommand 1 Poll of Available Data Understanding Parameter Options and Returned ValuesCommand 4 Send Data to Datalogger Command 2 SignaturesCommand 3 Flush all Receive Buffers Command 5 StatusCommand 8 Poll Tx Buffers for Data Command 6 Flush Transmit BufferCommand 7 Activate Command Line Command 9 Flush Converted Data BufferCommand 321 Execute Command Line Command Command 67 Get Return CodeCommand 320 Send Byte Data to SDM-SIO4 Program Example for P113 CommandExecute the command line string Command 1026 Serial Port Status Command 1024 Send String to DeviceCommand 1025 Transmit a Byte First Value ReturnedThird Value Returned First Command Option Reset Error CountersSecond 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 Command 2305 Transmit Bytes SDM-SIO4 Configuration ExamplesExample CR10X Program Set flag one high so the above will only be done once End of serial and filter setupGet two floating point numbers into locations 1 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 dataTime stamp Sensors Which Send Data Out Without PromptingGet data from SDM-SIO4 and put into locations 1 Instantaneous sample form the sensorExample CR10X Program without Polling or Interrupts Fltst 200 tdataA5xffGet the two floating point values from the SDM-SIO4 Example CR10X Program using the Polling MethodEnd of set up Instantaneous values stored to final storageDo filter set-up only if flag one is clear Set up string filterDelay required by filter set-up command Set flag one high so the filter set-up is only done onceGet voltages into locations 3 and 4 if poll was true Example CR10X Program using InterruptsInstantaneous value stored into final storage Delay required by filter setup command Do filter setup only if flag one is clearSet control port 8 to i/p so it can be used as an interrupt Instantaneous readings stored into final storage Interrupt routine for control portGet voltages into locations 3 End of interrupt routineOutputting Datalogger Data Return Error Codes Flushing the Input and Output BuffersError Detection with the SDM-SIO4 Data Error DetectionReceived Data SDM-SIO4 User Guide 2 CR10X Program Example Example of Using Received Data FiltersFltst 100 TFrequency=xg2n10fCCG8 End of filter setup Minimum delay of 4ms is required by the above P113Tell the SDM-SIO4 to use filter string 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 G8Minimum delay of 3.8ms is required after this command Use formatter string 100 to set up the CRC16 on portMinimum delay of 1ms 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 Stop Bits Appendix B. Serial Port Data Transfer ModesBaud rates Data LengthParity Bits Serial Handshake Modes