LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Power sensor automated selection

Hi!

 

I am trying to automate a piece of my program so that when a different power sensor is added due to them being used elsewhere or replaced when one breaks or goes to calibration, the program can check the sensor ID's and then select the sensor that is recording the forward power to be written to a column in the spreadsheet before the reflective power is written to the next column.

 

They are 2 Boonton power sensors with dedicated bungs on a wave guide that have USB connections, but for these particular sensors they don't appear in NI MAX as devices.  They are just checked for with a VI and then picked.  I have no idea how they are ordered and then selected but I assume that since the ID's are a string of numbers...the lower ID would be listed before the higher ID(purely speculation).

 

My question is, how would I go about checking the ID's to:

1. See if they match when the program was previously ran and if they match the 0th and 1st index...obviously determining nothing has changed?

2. If they don't match, then setting the new ID number in the place of the mismatch because that one obviously changed.

3. Writing the new ID to replace the old ID in a file so that next time the program runs the ID check will show they both match and write the data they record appropriately.

 

Alternatively, would it simpler to just check a value of the recording since the Forward Power is always significantly higher than the Reflective power and use that as a logical comparator and then have a true/false situation where the arrays are built with the power values being flipped for each situation?

 

In the attached VI, it would be very simple to accomplish the above idea for the column headers because they are outside of the loop so it would be a one and done check.  But for the actual measurements, it looks like a case structure would be comparing every single value before its passed into the array builder, which would work but turns into a situation where thousands of data points have to be correct every time or there will be instances where the values on the spreadsheet will be swapped in some places.

 

Any ideas on how to accomplish this? Thanks!

Download All
0 Kudos
Message 1 of 2
(125 Views)

Hi Jacob,

 


@wwjacobd wrote:

They are 2 Boonton power sensors with dedicated bungs on a wave guide that have USB connections, but for these particular sensors they don't appear in NI MAX as devices.  They are just checked for with a VI and then picked.  I have no idea how they are ordered and then selected but I assume that since the ID's are a string of numbers...the lower ID would be listed before the higher ID(purely speculation).

 

My question is, how would I go about checking the ID's to:

 

Any ideas on how to accomplish this? Thanks!


When you write "I assume" then I guess you didn't read the programming manual for your sensors!

  • What's mentioned in the manual?
  • Mind to share the manual?
  • When there are IDs: is there an option to read the ID from the sensor?
  • Which configuration options does the device driver support?

That's the way I would choose: read (configuration/ID) data from your sensors to know which sensor actually is in use…

Edit: It seems the "Find all Sensors" VI is doing this already for you…

 

Other stuff:

  • Even though your device driver returns SGL data I would convert them to DBL as long as you run your VI on a default Windows computer. No need for type conversion when you create a large 2D array after the loop…
  • I would make any conversion factors configurable. No need for "100k" numeric constants in the loop…
  • You can make the "digital display" visible of your charts, so no need for additional indicators!
  • Whenever you duplicate code you should think about using an autoindexing FOR loop instead! (Parsing the resource names, configuring two sensors in exactly the same way, …)
  • Building ever-growing arrays is dangerous! Building 3 of them even more so…
  • What's the point of wiring the filepath through your DAQ loop?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(73 Views)