GtDio6xConvertNumberToOpCode

Applies To

GX5296, GX5960, File

Purpose

Converts a number to Opcode.

Syntax

GtDio6xConvertNumberToOpCode (nNumber, pcOpCode, pnStatus)

Parameters

Name
Type
Comments
nNumber
SHORT
A number that represents an Opcode, see table below.
pcOpCode
PCHAR
Returned Opcode as a char.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

This function is a utility to help the user convert raw hex value read back from the board memory to the actual opcode.

Pin Action
Data OpCode
Hex Value
Disable Channel
'Z'
0
Collect CRC
'C'
1
Drive Low
'O'
2
Drive High
'I'
3
Repeat Previous Code
'R'
6
Invert Previous Code
'I'
7
Expect Valid Low
'L'
8
Expect Valid High
'H'
12
Expect Valid
'V'
13
Expect invalid
'B'
9
Drive Low, Expect Low
'I'
10
Drive High, Expect high
'h'
15
Drive Low, Expect high
'/'
14
Drive High, Expect Low
'\'
12

 

Example

The following example converts opcode hex value to its char opcode:

 

SHORT nStatus;

CHAR sZ[2];

 

GtDio6xConvertNumberToOpCode (0, &sz, &nStatus);

 

 

See Also

GtDio6xConvertOpCodeToNumber, GtDio6xGetErrorString