LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

message box in labview

venky,

 

i cant open your vi. mine labview is 8.5 and it detect your vi as 8.6. can you save in labview 8.5 or older version?

0 Kudos
Message 11 of 28
(2,584 Views)

Hi,

 

 

 Check out this vi.

 

 

 

Rgds,

Venky

0 Kudos
Message 12 of 28
(2,580 Views)

venky, thanks for your help. but have some problem when i running the vi u edit (mostly same as ravens fan vi problem).

 

1. at first when user selected 00:00:00, it is ok because the message is pop out. however, after click Ok on the message box, the message box is disappear and the time selection control also disappear. only can get it after stop and restart the vi.

 

2. when i select 00:00:01 can execute it, instead of every seconds save a data, the data was saved many many times in one seconds, as in the lvm file i attached.

 

3. user can selected running time at negative value, i.e: -00:00:05.

 

4. the temperature value just 0.7 for 0.8 for celcius (should be 28++) and for ferenheit just 32++ (should be 90++).

 

5. where is the GO! assistant? i cant find it in the block diagram but still this vi can be detected. (amazing!)

 

0 Kudos
Message 13 of 28
(2,569 Views)

MicK86,

 

1.  It wasn't clear from your original description that you wanted the delay on every iteration.  I thought you said you just want to delay the acquisition before the first time by the time delay amount.  The solution to that is to also put the time delay function inside the acquisition loop

 

2.  To prevent a negative delay time, use the in range and coerce properties on the control to prevent negative numbers from being chosen.

 

3.  I didn't touch your temperature conversion code.  Except I made the integer datatypes as doubles to eliminate the coercion dots.

 

4.  I don't know what the Go assistant is and I don't have it.  So it caused a broken run arrow for me.  I just replaced it with a random number generator for testing purposes.  You can add it back in.  I don't know what you mean by the VI is still detecting it.

 

Considering you are adding more requirments such as a pause mode, Venky's example might be the better one to base your code off of.  It uses a state machine architecture.  I would have two comments on his code though.  Instead of using a ring control to select the states, an Enum is a much better choice.  Then the case structure will have the names Init, Delay, Log Data, Stop in the top rather than the meaningless 0, 1, 2, 3.  Also, make a control with all your states and save it as a Type Def control.  Then use that control for all your constants.  This way if you later add another state to the case structure, all the constants will be updated automatically just by adding the new state to the .ctl control file.

 

Also,  I don't recommend burying the event structure inside the Init case.  It could be capturing events and it won't handle them until the Init case would execute again.  The better choice would be to look at the Producer/Consumer architecture with Events.  Here the event case is running in its own separate parallel loop and will capture the events as they happen.  And feed the commands to your state machine loop (the consumer) as needed by way of a queue.  There are a number of different variations that could make this work.  So I would recommend studying the examples in LabVIEW and also other threads on the forum that discuss state machine and producer/consumer architectures.

0 Kudos
Message 14 of 28
(2,563 Views)

Hi Mic_k86,

 

 

1. at first when user selected 00:00:00, it is ok because the message is pop out. however, after click Ok on the message box, the message box is disappear and the time selection control also disappear. only can get it after stop and restart the vi.

 ok

2. when i select 00:00:01 can execute it, instead of every seconds save a data, the data was saved many many times in one seconds, as in the lvm file i attached.

Ok..Check out this new vi.

 

3. user can selected running time at negative value, i.e: -00:00:05.

   Can u tell me why do u need negative time value. because now in code if  u say 5 seconds,the starting delay will be 5 seconds for data logging and log data once in every 5 seconds.

 

4. the temperature value just 0.7 for 0.8 for celcius (should be 28++) and for ferenheit just 32++ (should be 90++).

5. where is the GO! assistant? i cant find it in the block diagram but still this vi can be detected. (amazing!)

    In the code, instead of real hardware we are simulating the temp sensor by a random number(just for testing the code).So u will get value in these range only.Replace the random number generator block by the DAQ Assistant and pass the data .

 

 Rgds,

Venky

Download All
0 Kudos
Message 15 of 28
(2,562 Views)

Hi Mic_K86,

 

 

Yes Raven is correct.Do the requred changes as raven said.(Like change ring to Enum control and make that as type strict def).

 

 

 

Rgds,

Venky

0 Kudos
Message 16 of 28
(2,553 Views)

raven and venky, finally i know with the random number generator the software can be run without used of any hardware.

 

venky, i still have problem as i post previously (problem no.1). after error message pop out when 00:00:00, the time selection control still disappear. i try troubleshoot it but no idea.

 

change ring to Enum control and make that as type strict def? can give me more idea how to do this?

 

regard

0 Kudos
Message 17 of 28
(2,530 Views)

mic_k86 wrote:

 

venky, i still have problem as i post previously (problem no.1). after error message pop out when 00:00:00, the time selection control still disappear. i try troubleshoot it but no idea.

 


This you should be able to figure out by looking at the block diagram.  Use Ctrl-H to turn on context help and hover over the various functions and nodes in the diagram.Smiley Wink''

Also, I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
0 Kudos
Message 18 of 28
(2,523 Views)

Hi Mic,

 

 According to the code Temp data log.vi, the delay control will disappear once u press Start button and will appear when u press Pause button.

 

You can make the visible property of the control (Delay) to True to make it always appear in the frontpanel.

 

For changing the Ring const to enum ..

To make it easier for you to understand...just follow the below steps.

 

1. Right click on the Ring Constant ,and select change to control.

2. GO to Frontpanel,Right click on the Ring Control-- Select Replace---then select the drop down arrow in the bottom ---Select Modern---then Select Ring& Enum Function Palete---then Select Enum Control.

3. Click on File--Select New--select Custom Control under other files.

4. Copy the Enum control from the VI & Paste it in Custom control.ctl

5.In the Menu bar below the Project Menu ,You will find control is selected in the menu ring by default change that to strict type def. and save it in the name of custom control.ctl .

6. Go to that VI .Right click on the Enum control and select replace---Select "Select a VI" option ---select the custom control.ctl file.

7. Go to Block diagram of the Vi, Right click on the Enum control ----Select Change to constant.

 

8. Finally replace all other ring control to Enum by copying it pasting it.

 

Let me know if u need some more explanation.

 

Rgds,

Venky

 

 

 

 

 

 

 

0 Kudos
Message 19 of 28
(2,513 Views)

Venky, i not yet edit the ring const to enum part but i found a big problem here. when i change the random generator to go!assistant, the vi can work but will lagging. for example, when i set 1 second and run it for some period of time, then when i check the lvm file, i found that not every second data is collected. some time it will jump to 2 second. i retry using my previous vi is ok. is it possible to edit my previous vi instead of using your new vi?

 

p/s: actually i not very understand the block diagram you constract. seem different from labview 8.5 ( i mean the icon and symbol)

 

regard

 

mic_k86

0 Kudos
Message 20 of 28
(2,481 Views)