I am not sure of your skill set in writing optoscript code, but here is a sample of a simple loopback program. It is a beginning for you to get your head around things structure wise, and you can see it doing something. It is set for com port 0.
//sample code for sending and receiving data on a com port (loopback)
SetCommunicationHandleValue("ser:0,9600,n,8,1", spComHandle); //sets the com port number, baud, parity, data bits and stop bit
spStatus=OpenOutgoingCommunication(spComHandle); //open the port
//if we have success then we will continue
if (spStatus==0) then
/***** TRANSMIT PART *****/
//clear the buffer
//build a string to send out the port
spTxString+=Chr(13); //append a <CR> to the string (this will be our end-of-message terminator)
//transmit the string
/***** RECEIVE PART *****/
//now lets receive the string we just sent
//set the end-of-message terminator (this is the demarcation for strings) to <CR>
//check for data on the port and when we see some, exit (a timeout could be put here so an infinite loop doesnt occur)
//ok now we know there are chars there, read in the string
//close the com so we can do it all again
//the string in spRxString can now be parsed with some other code
What I do when working with any sort of communication data is to get familiar with the data structure using by either obtaining a manual/protocol or by using a terminal program to see (and log) the data. Once I am familiar with how the data is formatted, it makes it easier to visualize code structure.
Make sure you set the com port control function to 'None' in PAC Manager before using the above script. I think be default it is set for PPP.
If you can provide some examples I can try to assist you to achieve your goal.