11-17-2015 02:53 PM
OK, my example is pretty basic and not yet polished.
It is a first step in reading data from a custom device, viewing the raw data,
dumping a header and performing calculations on the data.
I don't have the custom device built yet but wanted to get the code feasibility figured out first.
thanks
11-17-2015 05:25 PM
As of right now, your U1 through U4 will never change. There values are going to be set by that "header" data you created. Even then, you are only reading 16 bytes, which would be just enough to read your cluster. You did not include any more data for your channel data.
Since you said this is coming from a customer device that you are in control of, you should be able to set the data format being sent. I would recommend using all ASCII data. So your U1 through U8 can be represented by 4 bytes each in an ASCII format to represent the hexidecimal values. Just to be consistant, seperate them by spaces. Then send the data stream with a Line Feed (0xA). If you configured VISA to use that as a termination character, then the read will finish when it finds that character. You just have to tell the VISA Read to read a large number of bytes.
11-18-2015 03:34 AM
Thanks Crossrulz
You wrote: "As of right now, your U1 through U4 will never change. There values are going to be set by that "header" data you created. Even then, you are only reading 16 bytes, which would be just enough to read your cluster. You did not include any more data for your channel data."
I guess I was too quick putting that VI together but I could fix this if I changed the first part to read 32 bytes in order to display 16 Uints of data, and add the 8 bytes for the header in the cluster, right?
Your suggestions for setting up the custom device sounds feasible but what I am really interested in knowing is, if I connect this to a device that is just pumping out a data stream consisting of 16 bit 2's compliment big endian hexidecimal data without any delimiters, then how can collect that stream of data and perform some calcuations on it.
In following up with my initial questions in this thread about using the string data as an input, I was looking to understand how to impliment the examples that you gave earlier with the string data in order to collect and convert the data with the calculations. So I put together the front part of the VI to accomodate your request, "This is when we again ask for an exact example of your input data and exactly what you expect for an output. Please include the cluster type as well."
In another reply, Altenbach wrote, "A binary string is not a spreadsheet string. You description is insufficient to solve the problem", but I am not sure what he means by that...
Sorry if I sound confused guys but I am new to this and seeking to understand how to collect a stream of data and perform some calcuations on it.
Thank you for your patience and help with this.
11-18-2015 02:16 PM
are there any LabView examples out there showing how to read a stream of binary data from a device into an array where the values can be converted or calculated?
I have been searching online and in my labview examples folders but am not finding anything,,,