LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I create an object (object control) programmatically?

I want to create an control object (boolean array) programmatically. Can LV create an object programmatically?
0 Kudos
Message 1 of 7
(3,342 Views)

Hi cmdrb,

search the forum for "scripting". http://forums.ni.com/ni/search?submitted=true&q=scripting Smiley Happy

Mike

0 Kudos
Message 2 of 7
(3,338 Views)
Before delving into scripting, which requires a license under 8.x, and is not officially supported under 7.x (though accessible if you know how), the first question to ask is: why do you need to do this? In other words, what are you trying to do?
Message 3 of 7
(3,332 Views)
I am creating a VI use to read I2C Data, by the way, this will be use on reading I2C Data on different I2C Data types. Currently, we have a vi on one of each product considering that each product have different number of data and different data types. I want to create a VI that will programmatically creates an array of booleans or numeric data depending on many data I need to display. 
0 Kudos
Message 4 of 7
(3,323 Views)
Ithink you're going about this wrong. I2C data is fundamentally an array of bytes, so there's no need to have a VI that "automagically" changes its output based on the device you're talking to. The I2C Read should simply return an array of bytes. What you do with that array of bytes depends on the device. This means you need to design your software in layers. You may even want to consider an object oriented implementation.

By the way, what are you using to implement the I2C in terms of hardware and software?
0 Kudos
Message 5 of 7
(3,314 Views)

yes, its the array of bytes, but each byte have will be converted to different data types, like for example, Model A, the first byte and second byte will be used for boolean status and for Model B, the first byte and second byte will represent as the component byte of a word (in which 1 word represent a specific value). Consider that some models have more than 60 bytes of data.

Currently we do have separate vi for Model A and Model B.

Now, what I wanted to make is a universal VI that above conditions, that what ever the type of data declared, it will create an object depending on the type of data declared. This object will be displayed in the front panel.

 

0 Kudos
Message 6 of 7
(3,302 Views)
Don't know if you're doing anything else with it, but you could create a table that formats the data into whatever format you want.  This is what I have done in the past.

For example, something I recently did:



The stream back from the device was just a serial data stream, and the end user has the ability to create a support file that tells teh program how to interpret that data.  This viewer just displays the enitre incoming message in a table.


Trying to dynamically build front panels is not a trivial matter.


Message Edited by Matthew Kelton on 04-30-2008 12:04 PM
0 Kudos
Message 7 of 7
(3,284 Views)