01-19-2015 06:01 PM
Hi 🙂 new user trying to grab hold of the NI-beast. ...and already hit up the wrong board once oops
I am trying to write a tool to capture readings from a FWB6010 Gaussmeter. The meter has a bunch of commands. I put together a few switches to send various commands to manipulate the settings on the meter eg :UNIT:FLUX:GAUSS or :SENSE:HOLD:STATE 1 for instance.
I would normally create an array containing these commands and then grab the appropriate command as needed, either by a numeric index or perhaps even by searching for the command name.
The examples and videos I've seen do not make me confident about this approach. Really don't want the commands scattered all over the code, though.
Any advice, examples, slaps in the right direction would be highly appreciated. Oh, and if you've already written something to suck the readings off a device like this, I'd love to hear more about it.
Thanks,
Thys
01-19-2015 06:07 PM
What I do is make a different VI for each command/read that I could send/read. Then you just have to call the VI you want. Take a look at the Agilent 34401 drivers that are shipped with LabVIEW for a good example of what I mean here.
01-19-2015 07:33 PM
01-20-2015 04:46 AM
@Dennis_Knutson wrote:
http://forums.ni.com/t5/Version-Conversion/Driver-FW-Bell-6010-gaussmeter-from-labview-4-02-to-12/td...
Wow. Nice find.
If there is a library already made for you, I recommend just using it. Apparently I converted some really old code a little over a year ago that should work for you.
01-20-2015 09:41 AM
CrossRulz, Dennis -- thank you for your responses, the links and the suggested examples.
I had found those FWB6010 files previously. Now I can say thanks to CrossRulz for updating them. I did not understand what they represented until now. I was looking for a "front door" VI that could be presented to a user and did not want them confronted with raw commands. The attached files show where my thinking was, rather than the approach of a separate VI for every command, as is the suggested/preferred approach with LabView.
So is the way forward is to create that front page UI and hook it to the various VIs in the library, or have I missed something else in that LLB?
01-20-2015 10:03 AM
Thys wrote:
So is the way forward is to create that front page UI and hook it to the various VIs in the library, or have I missed something else in that LLB?
Yep, you make a VI that calls those other VIs. Makes life a lot easier when you have abstractions like this.
01-20-2015 11:37 AM
01-21-2015 01:11 PM
Ah! An event structure sounds perfect. That's what I was looking at with that mouse piece in my example. The value change event makes good sense. Thanks!
01-23-2015 01:47 PM
@Thys wrote:
Ah! An event structure sounds perfect. That's what I was looking at with that mouse piece in my example. The value change event makes good sense. Thanks!
The term to use here is "Soft Front Panel" and really should be a requirement for any well constructed instrument driver.
01-23-2015 03:31 PM
Jeff I have no doubt you are correct. For the moment I want to get something working to prove the concept so people here will buy into LabView. I will go back and apply what I learn to improve my model as time goes on. Haaaaate leaving inelegant solutions lying around. Getting out of the ground has proven to be tricky!