02-03-2021 04:59 PM
I could use some help.
I am capturing live data using system exec.vi as shown below.
Can anyone tell me if there is a decent way to process the data as it is received?
My initial thought was to use "producer/consumer" principle but I am not sure how I would do under current circumstances.
Soren
02-03-2021 07:39 PM
Your time limiting step is probably the system exe.
Can you explain what you mean by processing?
Your path and file cannot change during the loop, so why are you doing all these repeated steps over and over? You should use "build path" (outside the loop!) for the file IO and built the entire commandline. Shouldn't there be some delimiters? You need "path to string" for the commandline, but there is no need for "string to path". Is it reasonable to set the scroll position to the string size? How does the file look like?
What does the cmd do? Just update the file?
02-03-2021 08:26 PM
Thank you for respond so quickly to my question.
Easy when you know how, right? I am obviously no an advanced user.
I am pulling IoT device data from an Azure iot hub with limited api access. The only option available to me at the moment is to use the CLI interface via system exec.vi to get the data. This is a slow process as I am pull the data from one device at a time. The azure command I have to use executes an infinite loop which system exec.vi is unable to return to me. This is why I have to write it to a file to get data. I then kill the CLI connection reopen it again ad start the process over for the next device.
I looked at running parallel executions and use multiple cores but have gotten nowhere with it.
So to sum it up. It is a cluster fu... but it is what it is at the moment.
Now the text file that the system exec.vi is writing to is updating and it allow me the access the vi did no. That is why I tried this loop solution.
So once again, any help is greatly appreciated.
Thanks
Soren
It is not a pretty solution but it is the closest I have as a test tool at the moment.
02-05-2021 04:42 PM
Did you have any good suggestions to problem?
I have been trying to use the producer/consumer principle. It might work but I am now stuck parsing the data messages from the file in sequence and without loosing any data.
02-05-2021 05:11 PM
Have to you tried running Wireshark to see what is being sent to the device? Perhaps you could reverse engineer what the communication between th ecommand line app and the device is. If that is possible, you might be able to recreate that in LabVIEW directly eliminating the command line method.
02-06-2021 09:19 AM
I have not. Goof idea though. I will give it a shot.
thank you 🙂
02-07-2021 05:06 PM
I was unable to derive useful data from Wireshark.
02-07-2021 05:09 PM
Is there really nobody who has experienced this problem before and can suggest a solution?
It seems highly unlikely to me.