Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Not sure why case structure dont work?

Hi,

 

i'm new to labview. I'm trying to achieve the following in a test system. A very simple task for some of you guys out there i'm sure...i have attached the VI so you can see it. Its certainly not sexy....what i need is to communicate with the serial testing device which i have working. I've got the array to work correctly and it saves off to a data file. I need to do some work on the file saving section but i think i'm ok with that.

 

I need it to be switchable depending on the test type.

 

Test type one is a simple test of just recording a result and saving it off. I press the button on my test equipment and it fires the string to the pc....this works fine.

 

Test type two is the same simple test, but i then need a string to go back to the test machine to tell it to switch it over to a secondary (different) test. I'm trying to do it with case structure but have a few errors and cant seem to fix them. I'm thinking test one done, fire string, record next result then back to test one again...

 

Can some one give me some pointers please?

 

 Thanks..

 

G

 

0 Kudos
Message 1 of 15
(4,541 Views)

Printerman, the first thing I see is that your case structure for Multimode/Singlemode is wired with a boolean to the case selector, but you have entered text in the case values at the top of the case.  When you wire a boolean the case must have True and False cases only. 

 

Second thing I see is that you don't have a control wired to the case structure inside the Singlemode case.  You have it expecting values of RL and IL but nothing wired to it. 

 

Reading your post can you describe a bit further what you need the Singlemode case to do?  I think I understood that you need it to execute both the RL and IL cases if Singlemode is selected, is that correct?

Troy
0 Kudos
Message 2 of 15
(4,536 Views)

Thank Troy,

 

I need the singlemode case to do a test (called Insertion loss), then the test equipment switches over and it performs a second test called return loss. The reason i need it to switch is due to the data in the string being in a different place. I also need the case to automatically switch the kit over for the second test then back again. 

 

Multimode testing only needs an insertion loss test hence the no switching...

 

Much appreciated Troy....

0 Kudos
Message 3 of 15
(4,529 Views)

Printerman, let me look at this a bit more closely and see if I can send suggestions on how to fix.  As I mentioned the code needs to be restructrued a bit.  We need to create a state machine here and you're close, I just need to put my brain on paper for you.Smiley Wink

Troy
0 Kudos
Message 4 of 15
(4,518 Views)

I have modified and notated your VI a bit to show you the state machine design that makes this work.  You can easily modify it to fit any need you have.  I set it up for "on demand" execution of the Read button, but it could be easily modified to run in a "continuous" mode.  It is also eaisly expandable to add additional functions.  Let me know if this works as you need, and if you have any questions about how this works and/or how to modify.

Troy
Message 5 of 15
(4,499 Views)

Hi Troy,

 

thanks for your hard work. This does not operate correctly though. It seems to cycle through the write to buffer commands and i can see them flickering in the complete string box. No data is captured from the devide. Even when i press the 'send data' button on the front of the device (which is how i'd like it to operate) nothing happens. I've tried with the read from serial on and off before running the vi then flicking it over. Still no capture.

 

I'll have a look at it here see if i can figure out whats going on but i must admit i'm confused as to the state pointer line. Do i need that if i just want the button on the machine to command the pc?

 

Thanks again Troy, much appreciated!

 

G

0 Kudos
Message 6 of 15
(4,488 Views)

Apparently I missed what you are trying to do.  Sorry about that.  Let me ask for some clarification.

 

Can you describe a step by step of how things should work and when?  Things like who/what initiates the test, and then who controls the test once it is running (LabView or some other piece)?  I believe I understood after reading the thread again that you would like to press a button the test gear and have it send data to LabView for recording for one part, but I didn't follow the second part.  

Troy
0 Kudos
Message 7 of 15
(4,461 Views)

Sorry for the confusion. I will try to clarify this as this is very important for me!

 

Multimode testing.

 

1. Plug the cable into the testing kit.

2. Press a button to record the insertion loss result.

3. Unplug the cable.

4. Reverse and test the opposite end for insertion loss.

 

Singlemode testing.

 

1. Plug the cable into the testing kit.

2. Press a button to record the insertion loss result.

3. The pc then makes the testing kit switch over to return loss automatically.

4. Press a button to record the return loss result.

5. The pc then makes the testing kit switch back to insertion loss automatically.

6. Unplug the cable.

7. Reverse and test the opposite end for insertion loss and return loss as above.

 

I hope that clarifies the process!

 

Thanks, your help is much appreciated.

 

G.

 

 

 

0 Kudos
Message 8 of 15
(4,449 Views)

Excellent.  Now it makes more sense.  Last couple of questions.  When you state "push a button" is this on the test fixture or in the LabView environment?  For the singlemode test, how does the PC know when to switch from the IL to RL test.  Is it something as simple as the test data from the fixture stops or are you looking for an indiciation in the data that shows the IL test is complete?

Troy
0 Kudos
Message 9 of 15
(4,437 Views)

Hi Troy,

 

yes its a button on my testing machine. Not a trigger in labview although both would help! LOL.

 

The test kit will just modify the the digital display as it monitors the insertion loss. It doesn't switch automatically do it its self hence i need the data to turn up on my screen via the pc then some sort of trigger to tell the test machine to then switch over.

 

Thanks again.

 

G

0 Kudos
Message 10 of 15
(4,428 Views)