LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structures -- same data/different case?

is it possible to pass the SAME information
out of different cases? ie.. wire output of one
case to also output in a diff case? independent of
booleen.

what i'm doing:
case structure controls whether data is graphed or not.
the case structure also controls program execution (ie... "F" stops the
program)

those two things are interdepent and i cannot seperate
program execution and the graphing option. ie i have
to stop the program by writing F to the case.

but.. while the program is running, "?" is TRUE and
everything works fine.. but when i hit the booleen to
stop the program, my case changes, the program stops,
but none of the data is written. (because nothing is
wired to the graph in the FALSE case)

that is, i have an
empty array wired just so i can
make the program run.. the case structure wont run
with an unwired output, of course.

-tony
0 Kudos
Message 1 of 10
(3,372 Views)
If I understand wht you're asking, it sounds like you need to move the update to the graph to outside the case structure--which is really where it needs to be logically. If the same thing needs to happen regardless of which case is selected, that function shouldn't be in the case statement.

Perhaps if you posted a bit of your code it would give me a better idea of your problem.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 10
(3,372 Views)
can't seem to post my VI... using outlook express.. adding
attachment. it "sends" but nothing shows up in the NG. ?
0 Kudos
Message 3 of 10
(3,372 Views)
The way to post code is to click on the rouns "Attach Files" button when replying. This brings up the File Attachments screen. Click on the first browse button and in teh resulting dialog box, find the file you want to post. Next enter a brief comment. When you click the "Continue" button, you browser will transfer the file.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 10
(3,372 Views)
mike,
try as i might my posts are not showing up here.
hate to be a bother, but is there an email address
i could forward the VI to?

you're input has been a great help and
i'd like to know what you think of my
case structure problem.

thanks again,
-tony
0 Kudos
Message 5 of 10
(3,372 Views)
If you're using Outlook Express to connect to the news group com.lang.labview, instead use your web browser to connect to NI's Developer Exchange at http://www.ni.com/devzone/dev_exchange/default.htm. Select the Discussion Forums link and you'll see a bunch of categories - LabVIEW General is the one you want to use. NI's interface to comp.lang.labview is much better than any news reader and allows for the attachment of files and has a search tool. You will be required to create a login id but the information you provide is confidential. Besides the ability to attach files, your email address won't be known as it would be when you use Outlook.
0 Kudos
Message 6 of 10
(3,372 Views)
mike,
thanks for your help. esp for the WriteTxtFile.VI.. the shift registers worked like a charm.

re: case structure. (hopefully) i have included a screen shot of my diagram. i didnt send the whole VI because it uses alot of Omega's subVIs for one of their boards.. and i want to keep the attachment size small.

at any rate, have a look. the FALSE case is
completely empty so i havent included that screenshot.

regardless of what this VI should do (buffered single channel AI), the while loop is controlled
by either
1) user break or
2) error generated from any of the subVIs.

inside of this VI you'll see the CaseStructure under debate. currently it outputs (interlaced) data to a numeric indicator. my VI requires an Array, so i
get a correlation between data point 1 and loop iteration.

if i pass the info out of the while loop (ie out of the case struct too) i need to wire something to the False case.

if i wired an empty array, when i hit the stop button, all of the data i acculmulted before that gets overwritten.

currently i am writing my data to a spreadsheet file. anddoing post-analysis. eventually (soon) i'd like to do it allin labview.

hence my dilemma.

sorry this is longwinded.
hope you can help.

thanks again,
-tony
0 Kudos
Message 7 of 10
(3,372 Views)
Ok, looking at the diagram I guess the biggest question is why the cse structure is there at all? As near as I can tell it's not doing anything except turning off the output on the last iteration. (I'm assuming that the signal controlling the case is one of the three inputs to the OR gate.)

What happens if you just lose the case structure altogether?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 10
(3,372 Views)
mike,
It seems the case structure is controlling dataflow..

I had tried removing the CaseStructure altogether, but
doing so results in the following error:

ERROR 9530 DaqReadBuffer.vi
Attempt to Read an A/D Buffer without
BUFFER_EMPTY_EVENT

the BUFFER_EMPTY_EVENT is the boolean you
see wired to the ? of the case structure.

if the buffer is not ready to be read, the programming in
the case structure should not be executed.

so,
a) how else could i satisfy this without using a case structure?
b) if i have to use the C.S., how can i get around the FALSE
case "erasing" the data i'd collected so far?

thanks,
-tony
0 Kudos
Message 9 of 10
(3,372 Views)
I think I see what's happening. Try replacing the case structure with a single-frame sequence structure and wire the signal that is now driving the selector node to the edge of the sequence. The wire doesnt have to connnect anywhere inside the structure, it just has to be wired to the edge. This will enforce the dataflow without imposing a logical operation.

There might be better ways of doing this but I'm not familiar with those specific drivers.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 10
(3,372 Views)