11-09-2017 11:56 AM - edited 11-09-2017 11:56 AM
Added in those changes, but the VI does not seem to work, the DAQ channels update crazy fast, and the serial connections just throw timeout errors, with an occasional blip of data that is mostly gibberish. How do I control the loop timing or is this automatic and there is something else wrong with the VI?
11-09-2017 04:09 PM
How do you know you are getting timeout errors? Did you put a probe or an indicator on the error wires?
What termination character are you using? Your Serial Configures don't have one wired in, to the default of a linefeed is used. But your VISA write in the bottom loop has a carriage return wired into the end of the command you are sending. It is very unusual for a communication protocol to use a different termination character on its send vs. its receive. So I'm guessing that you have one of them wrong.
11-17-2017 12:41 PM
How do I get my data out of the case structure? What am I supposed to wire to the tunnels for the other cases when the Data type is HR vs TC for example? I want this to run in parallel so that everythign is writing at the same time. I was expecting for example since the TC case runs at once every 2 seconds (0.5Hz), that it would just write the same numebr over those 2 seconds while writing at 50Hz for the DAQ inputs. but I have all these empty tunnels and I am not sure what to do with them.
11-20-2017 05:00 PM
LabVIEW12110,
Pictures of the case structure in question and a more in depth explanation of the aforementioned errors might help the community to assist on this one!
Thank You,
Brandon
11-21-2017 09:41 AM
Agreed that pictures of the newest version of the VI would help. In the last version posted there were no wires out of the case structure. I have two inefficient ideas for the question I think you might be asking.
I'm going out on a limb here and guessing that you're trying to store your data somehow now. If you really only need to populate outputs, you could use a local variable to call the current value in the front panel, or shift registers with the last value of each variable that are updated as new information becomes available. If this is done with the while loop you showed, however, it would generate a value for all variables whenever the value of any variable is dequeued. Depending on how long this will run, the number of data points could become unwieldy. Alternatively you could pass a NAN to each value not measured and then clean up the arrays later with a loop and case structure based on the the "is NAN?" operation. Like I said, two inefficient ideas.
It would help to know exactly what you would like to do with the data outside of the case structure.
11-27-2017 01:01 PM
I am trying to write to TDMS like you suggest, but I get so many empty tunnels, what should I do with them? I want to write to a single file but if I do I get a 0 in the column every time it switches between cases in the data loop. Can I resolve this by giving up on the one file idea and just have separate queues and files for each different data rate? Or do I put in local variables everywhere there is any empty tunnel. Ideally I want the data to write the same number until a new number appears. So i fully expect the 1Hz one to have 50 of the same value while the 50Hz data rate to have 50 different numbers every second.
11-27-2017 01:18 PM
You are making things way too difficult. Put the TDMS write inside of each case of the logger loop. You write only what you need to for each message you received. You can add some additional code so that you go into a "No Log" case when you have the Write Data set to FALSE.
11-27-2017 01:46 PM
@crossrulz wrote:
You are making things way too difficult. Put the TDMS write inside of each case of the logger loop. You write only what you need to for each message you received. You can add some additional code so that you go into a "No Log" case when you have the Write Data set to FALSE.
How do I wire it to make sure they all end up in the same file in the correct column without bundling them up first?
Also when you say you only write what you need to for each message, does that mean I will have a "0" or NaN in each cell whenever there isn't data? That is what I am trying to avoid.
11-27-2017 02:00 PM
You are writing to a TDMS file. So have a different group for each type of data you are collecting. So you just write to a single group at a time.
11-27-2017 03:03 PM
Is this mostly correct? I just realized I have them all going to the same group when they should have been separated. But other than that is this setup correctly? I want to be able to input markers in my data with the button press as well, and I need to record the time somehow. For some reason this does not record at 50Hz, it's more like it just records as quickly as possible...