Read all data from serial port


seth

Recommended Posts

I am using a Brooks SLA5800 series MFC, and the protocol does not define a data length or end character which is easy to read back queried information with. In Python I have been able to read the entire serial buffer to parse out the data required. I don't see an immediately obvious way to accomplish this in DAQFactory, is there a way I can do this? The protocol allows for an arbitrary number of start bytes which makes it very difficult to accomplish this without being able to read the full serial buffer.

 

Thanks!

Link to comment
Share on other sites

I was trying to use the From.Float function in DAQFactory to get a binary representation of a float value in the IEEE 754 format. The values it was giving were not matching up with online calculators or using struct in Python. I figured out I needed to pass the DAQFactory value into ChrA to format it in the same way as the others, and it now matches up and works properly. So the end result was ChrA(From.Float(value)) which aligned with other sources output.

Link to comment
Share on other sites

Thanks.  You need to use chra() because all the DAQFactory serial functions expect a string, not an array of bytes.  ChrA() takes an array of bytes and creates a string out of it with one character per array element.  asca() does the reverse.  The non-a functions: chr() and asc() apply to a single character / number.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.