Read data via RS323

Baha B.
Yavne,

Aug 14, 2012
2 Posts

0  |  0  

Re: Read data via RS323

Hello,
I need to read data via RS232 ,
Unfortunately mu code isn't working
Could anyone please point where i'm wrong?

This is part of my code :

iStatus = ComOpen(iPort)
iStatus = ComSetup(iPort,iBaudRate,iDataBits,iParity,iStopBits,iHandshake)
iStatus = ComReceive(iPort,sEOS,iTimeout,iMode,sStr,iByte)
Print "sStr is : " ; sStr
iStatus = ComClose(iPort)


Any help is welcomed !!!

Solution Available
Victor B.
Lake Forest, CA

Aug 14, 2012
93 Posts

1  |  0  

Re: Read data via RS323

Hi,

After calls to the functions ComOpen, ComSetup, ComReceive you should check the iStatus variable to see which function is throwing the error.

Try this:
iStatus = ComOpen(iPort)
if iStatus=-1
    error -100, "ComOpen() failed"
endif

If you need further help, please post your code with the actual arguments instead of variables.

Regards,
Victor Brode

Baha B.
Yavne,

Aug 14, 2012
2 Posts

0  |  0  

Re: Read data via RS323

Hi Victor,

It work nice !!!!!

I forgot to update variable of  function ComReceive() , iByte remains be zero ,that the reason why i cant read anything.

Thank you very much  :)

Regards,

Baha



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]