LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify the 'match pattern' which depends on an enum?

I wish to specify a special match pattern when save file which can be selected by an enum. Such as, when I select 'TXT' on an enum, then the file's pattern is '.txt'. When I select 'DOC' on the enum, then the file's pattern is '.doc'. If this can be realized? Thanks alot!
0 Kudos
Message 1 of 6
(2,848 Views)
You can extract the string from an enum by using Format Into String. Wire
"%s" into the "format string" input, and wire your enum into the "input1"
input. Out comes a string that you can use to assemble your pattern.

-Chris

"yjiang" wrote in message
news:506500000008000000139F0000-1042324653000@exchange.ni.com...
> I wish to specify a special match pattern when save file which can be
> selected by an enum. Such as, when I select 'TXT' on an enum, then the
> file's pattern is '.txt'. When I select 'DOC' on the enum, then the
> file's pattern is '.doc'. If this can be realized? Thanks alot!
0 Kudos
Message 2 of 6
(2,848 Views)
LabVIEW 7.0 has a new control called a combo box that would be perfect for you. The front panel object looks like an enum, however the output of the block diagram terminal is any assosiated string you would like.
0 Kudos
Message 3 of 6
(2,848 Views)
Thanks for your response. I think I can use the corresponding string in the case frame to link out which seems easier. I am only purchase the LabVIEW for about 1 year. The most hard point I wondered is how to set in the path node. And I also wish to add the date information in the file path. But the most important to me is to add an optional pattern. Can you tell me in detail? Thank you!
0 Kudos
Message 4 of 6
(2,848 Views)
I'm not sure what you are asking, but wouldn't using Build Path and Strip
Path do what you want?
You could take a date number, format it into the string you want and wire it
into the Build Path. If you want to have a variable extension, you could
append on the extension to your string before wiring it into Strip Path. I
can send you an example if you want.

-Chris

"yjiang" wrote in message
news:5065000000050000001A1E0100-1042324653000@exchange.ni.com...
> Thanks for your response. I think I can use the corresponding string
> in the case frame to link out which seems easier. I am only purchase
> the LabVIEW for about 1 year. The most hard point I wondered is how to
> set in the path node. And I also wish to add the date information in
>
the file path. But the most important to me is to add an optional
> pattern. Can you tell me in detail? Thank you!
0 Kudos
Message 5 of 6
(2,848 Views)
Thanks, maybe I did not express clearly. I wish to specify the file's pattern by using an enum. I guess it should be set at the 'File Path' node, but don't know how. It is better to add date information in the case. If you can give me an example vi is the best. Thank you!
0 Kudos
Message 6 of 6
(2,848 Views)