Jump to content

Writing a config file


Recommended Posts

I am trying to put together a VI's 'state so it can be re-loaded. I was hoping to pass in only a cluster and have the config file use the name of the Cluster as the section then in that section have each element of the cluster as a key in that section i.e.

[Cluster1]

Span=50

Speed=20

Home=TRUE

Enable=FALSE

Carrier Size=127

[Cluster2]

Span=10

Speed=100

Home=FALSE

Enable=FALSE

Carrier Size=127

This is what I've come up with... but I get the following error "These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required.

The type of the source is Variant.

The type of the sink is boolean (TRUE or FALSE).can't get the value out right."

The write.value input is set as Automatic

Any comments or suggestions would be appreciated

Derek

post-7249-1170763619.jpg?width=400

Link to comment
You can convert variant data to boolean using Variant To Data and as type an boolean constant.

Yeah but I'd like to set up the one VI to write the cluster to the file and determine the Data type at run time, the example posted is a trivial one to test my ideas out. In my final application it's likely to be 20->30 variables that's likely to change frequently during development.

Hoped I'd be able to use Variant to Flattened String then use the data type String in a case statement to define the data type but I couldn't get that working either.

I'm off to look at the variantconfig package, thanks to both of you for replying

Derek

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.