03-28-2019 10:30 PM
May I ask if anyone here has any experience with using the ActiveX classes in Labview. It seems that within my VI, there is a problem with the Variant to Data function, it keeps returning “Error 1 has occurred at incorrect function in the VI.” Sometimes, it returns Error 91 too. Running the VI without connecting the external sensor still results in the error. The purpose of this VI is to read Data from the external sensor and log data into a CSV file. I am using Labview 2018 version 18.0(32-bit)
03-28-2019 11:59 PM
I don't know if this would be causing your problem, but it sure doesn't help, but your VI is inside out. You have case structures on the outside and while loops inside of them. And with those while loops, because the stop condition is fed from outside of the loop, those loops will either run only 1 time if the boolean is true, or run forever if boolean is false. The only way to stop your VI would be to abort it.
It seems like you don't understand the concept of dataflow so I suggest you take some tutorials in LabVIEW first.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
03-29-2019 12:38 PM
Hello Rollingball,
I would certainly change the structure of the loops, as said by our Ravens Fan friend. Data flow structure is too important in LabVIEW.
I also recommend some SubVI's because this is quite hard to read, unless you are on widescreen monitors!
Is there a reason you were bypassing the Error Out on your Variant to Data after the ScanUSB? After re-wiring that the error goes away! (Error 91 that is).
03-30-2019 03:35 PM
Hi RavensFan,
Thank you for your suggestion. I have look through the online manuals you have recommended and I will try to make amendments. I do want to point out that there are still some errors after I put the Stop button inside the while loops. However I think i should look into how I can change the loops/case structure in the VI before posting again thank you.
03-30-2019 03:40 PM
Hi CMullinsEE, I have thought making subVIs for this program before however, I do not know how to make a SubVi that could deal with my activeX functions. And I can technically focus on one of the loops as the other 3 are duplicates. The program is suppose to run 4 loops in parallel. Btw, I have miss out the error out for the first variant to data and have reconnected the error wires, thanks! 🙂