LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert Null to Database without query (Columns type are Boolean and Float)

Dear All,

I am trying to Insert Null to 2 columns in a particular record.

Condition:

- if value of Acquired Signal < Threshold, write NULL (not numeric 0) to 'SensorVoltage' and 'ProductProximity' columns.

SensorVoltage column is 'float' datatype ----- I need to insert Null here (not 0)

Product Proximity is 'Boolean' datatype ----- I need to insert Null here (not 0).

 

I saw a few methods to do so using query, but i can't do so since the acquired signal 'SensorVoltage' is acquired in realtime (not from a historic DB that a query can be run on).

Also, there was a method that used 'DB Tools Null.vi' to generate a 'NULL'. The problem while using this VI from Database Toolkit is that, the cluster i am making (which would then be converted to a variant), requires float and boolean input. The aforesaid vi gives a NULL output, but the datatype is 'variant' (which when trying to convert to boolean or float, gives an error).

 

Any suggestions ?

 

Thanks for reading, helping and suggestions.

- Nishant Patel

 

 

0 Kudos
Message 1 of 2
(2,512 Views)

Floats and booleans cant be NULL, that's correct. You'll need to do some workaround, as building your query yourself, or using Variant as datatype in the cluster. Then, in the next step trying to convert to the correct form (float/bool) if it fails change the value to NULL in the query.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 2
(2,491 Views)