06-20-2022 10:00 PM
Howdy from Med Industry in Arizona Labview Gurus -
Long Term Objective: Precisely Acquire Data from Multiple Serial .net DLL instruments, Parse Data into a Usable Format and Plot, Save Arrays, Data, Status ; Optimization 1) Samples/Second
Question [Red Pen]1) Well for starters, is the use of clusters in this subvi reasonable? Should all I/O be clustered and broken out as a whole or secondary/tertiary structures if I want to call this function, nput a type def or queue message and let it rip through some read/write gauge params.
Question [Gold Pen]2) Is there a best practice for handling the passing of .net/device handle references? [I Should note, this driver NOW WORKS in line and standalone (I can say gauge get params, gauge get data fast, gauge get data point, etc. and the connection closes properly each time.) Really, I just want to do this right and I know that theres like a bazillion rules I could be breaking so here it goes. 'Fast Data' speed is set via the dll and LV receives the packet, parses and formats (could use some help there), converts to spreadsheet string, and builds array for XY graph - should I be using waveform instead?
Below is a snippet of the stock futek driver, the 'Fast Data' one was organized similarly, so I wrote it as states with the Futek Type Def Driven state machine.
[FUTEK OLD 32BIT [working LV rework attached in said state machine ]
If i don't close it like this it completely kills the connection and only a connect reconnect resolves the issue. - This config is tested and working stable.
Some more background/further notes:
A question regarding enumerating devices, State machines and action engines, and some general .net know how.
So the good news is that I have successfully configured the futek .net dll for the usb digital amplifier. For anyone out there searching, try copying the .net dll into the LV env exc dir. The STOCK FILES from Futeks server are sort of clunky. I reorganized them into a state machine with a type def ctl per a LV Colleagues other examples/teachings. I am a self taught LV student and study literature and examples as they are recommended. I am looking to further my LV ed formally as time permits, but best practices and users manuals are all that I utilize [*probably in most cases poorly] to Construct automated test and measurement systems using Labview. Proposed fix on said driver (not that I would even now how to begin proccessing code on that level) Fix on Futek_Usb.dll
Then there is some relinking of references -- perhaps my state machine will completely break down upon driver build!?!? Long term goal is to run a 3up linear actuator force test station and do some feedback control via ethernet steppers.
Any suggestions on structures, action engines, front panels?
06-21-2022 03:56 AM - edited 06-21-2022 03:59 AM
That first diagram you show is one huge mess. I think it really needs a lot of refactoring far beyond if those bundle and unbundle should be inside or outside the loop.
Another notice I saw which I think is not going to fly well if you ever intend to distribute that library to customers is about the location of the USB_DLL assembly.
The DLL file to be used is the one found with the VI in the VI example folder.
That's NOT how .Net assembly resolution generally works. You can kind of make it work within the LabVIEW development environment if you press the right buttons in the right order at the exactly right rythme but one bit off in that and things start to fall apart and the only way to get it then right, often is to restart LabVIEW and try again.
And once your users start to build executables all bets are off. Such assembly DLLs either need to reside in the executable directory (were your exe file is that started up the current process), in the project directory for the current LabVIEW project if you work in the LabVIEW IDE, or in the Global Assembly Cache (GAC). Anything else is trying to fight with windmills in the long run.
Of course in order to be able to install an assembly in the GAC it needs to be strongly named (with full version number and crypto signature) and you need to provide an installer for your end users to place it there as telling them to do it themselves is not gonna fly well with most potential users either.