If you use PCF to get data from MQ, you get many data fields as numbers. For example the trigger value 3 means Trigger on Depth.
Although MQ provides functions in CMQCSTR.H which provide this mapping (MQTT_STR for trigger type). You needed to hardcode the datatype with the formatting function.
I've put up the a mapping header file for the PCF type to formatting function in
GitHub. I've also provided some code so you just need to issue
getPCFValue(MQLONG what,
MQLONG value,
char **pWhat,
char **pValue,
char **pPValue);
Where
- what is the PCF data type (MQIA_TRIGGER_TYPE)
- value is the PCF value (for example 3)
- pWhat gets the name of the PCF data type ("Trigger_Type")
- pValue gets the value returned from the MQ provided function("MQTT_DEPTH")
- pPValue gets the prettified value, with the prefix removed, and the remained made more readable("Depth")
This will allow you to run along PCF data and display all the data and values in a similar manner to a display command.
If there are any problems with it, please let me know.