03-29-2012 10:26 PM
03-31-2012 11:44 PM
if you can tell me about the packet format you are using , i can give you better suggestions. What information i need is "does your packet is of fixed length or variable length"?
however in either case most probably you wont be requiring circuilar buffer.
.
Tushar Jambhekar
tushar@jambhekar.com
Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog
04-01-2012 06:19 AM
i think that is the problem, there is no packet size. Teh data is continuosly being streamed to the computer.
04-01-2012 06:28 AM
let me put my question in different words.
what should be the parsing logic for comand.
OR
can you put some recorded stream data coming on port. and then may be describe it.
Tushar Jambhekar
tushar@jambhekar.com
Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog
04-01-2012 06:33 AM
Well there are 2 analog boards and 4 channels on each board. The data from each board is 16 bits. There is a delimiter in front of each channel to identify the data from each channel. When the data is being streamed to the computer, first the delimiter must be identified and then the string will be broken up into a substring with length 2 (to represent 16 bits from each channel). I have no problem decoding the data, my biggest worries is to try and display real time data, while still ensuring that there is not data overflow and preventing a lost of information. That is why I thought that the circular buffer might helped in this situation.
04-01-2012 04:48 PM
kevin,
Generally the best way to avoid data loss from a streaming source is to use parallel loops. One loop reads the data and puts it into a queue. The second loop pulls data from the queue and decodes, analyzes, displays, saves, ... whatever.. The second loop can run much slower so long as it can remove the data from the queue fast enough to avoid memory overflow.
Look at the Producer/Consumer (Data) Design Pattern which comes with LV.
Lynn
04-02-2012 01:37 PM
Hi there
Okay so i have implemented a queue in my program, where I will read the data in one loop and then have a second loop that will decode the data. However the I have a new problem. The queue for the decoding loop does not seem to reach the loop or does not enter the loop. I have attached my VI and I am worrying if someone could look it over and tell me if I am doing something wrong or what might be causing this problem.
04-02-2012 04:15 PM
There is actually very little that is correct in your program. The major problem is that you have created a data dependency between loop 1 and loop2 because you've wired the error out/VISA ref from loop 1 to loop 2. Therefore. loop 2 cannot start until loop 1 finishes.
You really need to do a lot of cleanup. You could just have an event structure in the top loop where you do a read in a timeout event. Add labels for the controls you have in the event structure. The stop button should stop the loop. Do NOT use the LabVIEW Stop function anywhere in your code.
You can use a single case statement in your bottom loop. No need for all of those silly equal to comparisons. You can wire a string directly to the selector.
I don't understand what you are attempting with the feedback node. It looks like you are continually initializing it.
Look closer at the producer/consumer example. There is a lot you are missing.