Hallo,
i have some problems with RS232 Port.
For using this port, i want use a Lab CVI Function.
So I do this:
/* Open and Configure Com port 1 */
OpenComConfig (1, "", 9600, 1, 8, 1, 512, 512);
InstallComCallback (1, LWRS_RXFLAG, 4, (int)gEventChar[0], Event_Char_Detect_Func, 0);
...
/* Close the open COM port before exiting */
CloseCom (1);
So I have a callback, if something arrived:
/***********************************************************************************************************************/
/* Event_Char_Detect_Func (): Function wird aufgerufen, sobald ein event character am Com Port entdeckt wird. */
/***********************************************************************************************************************/
void CVICALLBACK Event_Char_Detect_Func (int portNo,int eventMask,void *callbackData)
{
char outMessage[256];
sss = ComRd (1, readBuf, 1);
if(sss==1)
{
...
}
return;
}
Now I want read the velue which arrived on my RS232.
I think the communication with my controller is OK, because the callback is called if i send something with my controller.
But I can`t see the velue, which arrived!!!
Can you tell me, how I can see the Hex velue from my arraving velue?
I can use: ComRd (1, readBuf, 1);
but this is not the coorct hex velue, or?
Is this correct, that the connect is OK, when the callback is called if my con. sent something?
Please help me to see the hex velue. Perhaps you can send me one more Example with a RS232 to read a hex velue and config the port.
Can I read immediately, or must I send first something to the controller for recognition?
Thanks!!