Skip to content

mbus HFCE Packet At Index.vi


Description

The HFCE Packet At Index is an advanced function to extract HFCE Messages out from corrupted HFCE data.

Refer to HFCE Message At Index to extract HFCE Messages from valid HFCE data.

Using HFCE Packet At Index in a loop parses the hfceMsgs into individual messages. The hfceMsgs represents the received buffer for HFCE data. It is composed of successive 16-bit words, supposedly coding for label, payload size, N data words and so on. With HFCE Packet At Index, messages are separated one from the next based on the hardware packets delimiters (preamble and postamble), and not based on the payload size words, that could be corrupted.

For example:

Received hfceMsgs shows:

hfceMsgs word # 16-bit word
Index #0 0x00AA (message 1's label)
Index #1 0x0007 (corrupted payload size)
Index #2 0x0011 (data 0)
Index #3 0x0022 (data 1)
Index #4 0x0033 (data 3)
Index #5 0x00BB (message 2's label)
Index #6 0x0004 (payload size)
Index #7 0x1100 (data 0)
Index #8 0x2200 (data 1)
Index #9 0x3300 (data 3)
Index #10 0x4400 (data 4)

By using mbus HFCE Packet At Index in a loop, returned HFCE messages are:

Message #0 16-bit word
Label 0x00AA
Payload size 0x0007
Data word #0 0x0011
Data word #1 0x0022
Data word #2 0x0033
Message #1 16-bit word
Label 0x00BB
Payload size 0x0004
Data word #0 0x1100
Data word #1 0x2200
Data word #2 0x3300
Data word #3 0x4400

The corrupted payload size has no impact.


Parameters  
error in in error conditions that occur before entering the function
hfceMsgs in HFCE receive messages
wordCount in number of HFCE words received
msgIndex in start index of the HFCE message to decode
packetSize in HFCE packet size
label out HFCE message label
payloadSize out HFCE payload data size in 16-bit words
nextMsgIndex out start index for the next HFCE message
packet out HFCE packet
payloadData out HFCE payload data
error out out error information
function return out function execution status


Availability

Available in Multibus VI 1.0 and later.

See Also

mbus HFCE Message At Index.vi

Examples

HFCE Error Injection and Detection.vi
HFCE Send Receive Advanced.vi