seth Posted October 11, 2024 Posted October 11, 2024 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! Quote
AzeoTech Posted October 11, 2024 Posted October 11, 2024 If you do read(0) it will give you everything currently in the buffer. So: device.myDevice.read(0) This is described in 16.6 of the users guide: https://www.azeotech.com/help/16_6-comm_low_level_comm.html Quote
AzeoTech Posted October 11, 2024 Posted October 11, 2024 Can you post your question and what you figured out? It might be useful to someone else. Quote
seth Posted October 15, 2024 Author Posted October 15, 2024 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. Quote
AzeoTech Posted October 15, 2024 Posted October 15, 2024 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. Quote
Recommended Posts
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.