From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to tell your platform type?

I'd like to be able to tell the platform type (unix, mac, windows) that
a VI is running on so that I can better parse text files. Does anyone
know of a nice way to do this?

-- Stephen
0 Kudos
Message 1 of 9
(3,294 Views)
Stephen Boulet wrote:

> I'd like to be able to tell the platform type (unix, mac, windows) that
> a VI is running on so that I can better parse text files. Does anyone
> know of a nice way to do this?
>
> -- Stephen

You can open an application reference (under VI server palette) and
use the property node. One of the properties is the OS name,
If you need more I have a VI that looks at this.

There is also an example some where.
Kevin Kent
0 Kudos
Message 2 of 9
(3,294 Views)
Hi Stephen

I asked this question once. You use the "Open Application Reference"
function (Application Control) (with no inputs) and wire the reference
number to a "Property Node". Then pop up on the element in the Property
Node and choose "Operating System: Name"

Paul
--

Research Assistant
School of Physiotherapy, Curtin University of Technology
Selby Street, Shenton Park, Western Australia, Australia. 6008
email: P.C.Davey@curtin.edu.au
Tel. +61 8 9266 4657 Fax. +61 8 9266 3699

"Everyone who calls on the name of the Lord will be saved." Romans 10:12
"For all have sinned and fall short of the glory of God, and are justified
freely by his grace through the redemption that came by Christ Jesus."
Romans 3:23-4


Stephen Boulet wrote:

> I'd like to be able to te
ll the platform type (unix, mac, windows) that
> a VI is running on so that I can better parse text files. Does anyone
> know of a nice way to do this?
>
> -- Stephen
0 Kudos
Message 3 of 9
(3,294 Views)
Can someone on a windows platform do an experiment? The "empty path"
constant, when routed to a path to string converter, returns the empty string
for Macintosh and a forward slash for unix. I'm hoping that it will return a
backwards slash for windows.

Thanks.

-- Stephen
who is still using labview 4.1


Paul Davey wrote:

> Hi Stephen
>
> I asked this question once. You use the "Open Application Reference"
> function (Application Control) (with no inputs) and wire the reference
> number to a "Property Node". Then pop up on the element in the Property
> Node and choose "Operating System: Name"
>
> Paul
> --
>
> Research Assistant
> School of Physiotherapy, Curtin University of Technology
> Selby Street, Shenton Park, Western Australia, Australia. 6008
>
email: P.C.Davey@curtin.edu.au
> Tel. +61 8 9266 4657 Fax. +61 8 9266 3699
>
> "Everyone who calls on the name of the Lord will be saved." Romans 10:12
> "For all have sinned and fall short of the glory of God, and are justified
> freely by his grace through the redemption that came by Christ Jesus."
> Romans 3:23-4
>
> Stephen Boulet wrote:
>
> > I'd like to be able to tell the platform type (unix, mac, windows) that
> > a VI is running on so that I can better parse text files. Does anyone
> > know of a nice way to do this?
> >
> > -- Stephen

--
Stephen Boulet
Senior Electrical Engineer
Schaumburg BTS COE Lab
Motorola Network Solutions Sector
Phone: 847-576-4399
Fax: 847-538-3765
0 Kudos
Message 4 of 9
(3,294 Views)
Stephen,

I ran your test on an NT box running LV 5.1. It returned an empty string.
Sorry.

Jim


Stephen Boulet wrote in message
news:39F05AB9.4F66DCD2@comm.mot.com...
> Can someone on a windows platform do an experiment? The "empty path"
> constant, when routed to a path to string converter, returns the empty
string
> for Macintosh and a forward slash for unix. I'm hoping that it will return
a
> backwards slash for windows.
>
> Thanks.
>
> -- Stephen
> who is still using labview 4.1
>
>
> Paul Davey wrote:
>
> > Hi Stephen
> >
> > I asked this question once. You use the "Open Application Reference"
> > function (Application Control) (with no inputs) and wire the reference
> > number to a "Property Node". Then pop up on the el
ement in the Property
> > Node and choose "Operating System: Name"
> >
> > Paul
> > --
> >
> > Research Assistant
> > School of Physiotherapy, Curtin University of Technology
> > Selby Street, Shenton Park, Western Australia, Australia. 6008
> > email: P.C.Davey@curtin.edu.au
> > Tel. +61 8 9266 4657 Fax. +61 8 9266 3699
> >
> > "Everyone who calls on the name of the Lord will be saved." Romans 10:12
> > "For all have sinned and fall short of the glory of God, and are
justified
> > freely by his grace through the redemption that came by Christ Jesus."
> > Romans 3:23-4
> >
> > Stephen Boulet wrote:
> >
> > > I'd like to be able to tell the platform type (unix, mac, windows)
that
> > > a VI is running on so that I can better parse text files. Does anyone
> > > know of a nice way to do this?
> > >
> > > -- Stephen
>
> --
> Stephen Boulet
> Senior Electrical Engineer
> Schaumburg BTS COE Lab
> Motorola Network Solutions Sector
> Phone: 847-576-4399
> Fax: 847-538-3765
>
>
>
0 Kudos
Message 5 of 9
(3,294 Views)
Sorry, it returns an empty string..
Actually the solution to your problem comes from somewhere else.

What you have to do is find out what an "End of Line" constant looks like on
each platform.

If the "End of Line" constant is equal to a "Carriage Return" constant then
you have a Mac.
If the "End of Line" constant is equal to a "Line Feed" constant then you
have Unix.
If the "End of Line" constant is equal to a "Carriage Return" constant
concatenated with a "Line Feed" constant then you have a PC or a "Gates
Box".

Everything else is Unknown platform. I wonder what Linux returns....Hmmmm.

Thank You

Michael Aivaliotis
Senior Developer
Cymasoft Inc.
Tel: 416.984.9100
email: michael@cymasoft.com
web: www.cymasoft.com


> -----Original Message-----
> From: stepheb@comm.mot.com [mailto:stepheb@comm.mot.com]
> Sent: Friday, October 20, 2000 10:46 AM
> To: comp.lang.labview@list.deja.com
> Subject: Re: How to tell your platform type?
>
>
> Message from the Deja.com forum:
> comp.lang.labview
> Your subscription is set to individual email delivery
> This message was sent to michael@cymasoft.com
> Deja.com: Best way to buy a PC
> http://www.deja.com/channels/channel.xp?CID=13031
> >
> Can someone on a windows platform do an experiment? The "empty path"
> constant, when routed to a path to string converter, returns the
> empty string
> for Macintosh and a forward slash for unix. I'm hoping that it
> will return a
> backwards slash for windows.
>
> Thanks.
>
> -- Stephen
> who is still using labview 4.1
>
>
> Paul Davey wrote:
>
> > Hi Stephen
> >
> > I asked this question once. You use the "Open Application Reference"
> > function (Application Control) (with no inputs) and wire the reference
> > number to a "Property Node". Then pop up on the element in the Property
> > Node and choose "Operating System: Name"
> >
> > Paul
> > --
> >
> > Research Assistant
> > School of Physiotherapy, Curtin University of Technology
> > Selby Street, Shenton Park, Western Australia, Australia. 6008
> > email: P.C.Davey@curtin.edu.au
> > Tel. +61 8 9266 4657 Fax. +61 8 9266 3699
> >
> > "Everyone who calls on the name of the Lord will be saved." Romans 10:12
> > "For all have sinned and fall short of the glory of God, and
> are justified
> > freely by his grace through the redemption that came by Christ Jesus."
> > Romans 3:23-4
> >
> > Stephen Boulet wrote:
> >
> > > I'd like to be able to tell the platform type (unix, mac,
> windows) that
> > > a VI is running on so that I can better parse text files. Does anyone
> > > know of a nice way to do this?
> > >
> > > -- Stephen
>
> --
> Stephen Boulet
> Senior Electrical Engineer
> Schaumburg BTS COE Lab
> Motorola Network Solutions Sector
> Phone: 847-576-4399
> Fax: 847-538-3765
>
>
>
>
>
>
> _____________________________________________________________
> Deja.com: Before you buy.
> http://www.deja.com/
> * To modify or remove your subscription, go to
> http://www.deja.com/edit_sub.xp?group=comp.lang.labview
> * Read this thread at
> http://www.deja.com/thread/%3C39F05AB9.4F66DCD2%40comm.mot.com%3E
>
>



Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 7 of 9
(3,294 Views)
If your problem is only about end-of-line characters, you can use the
"Convert EOL" input of the read and write file functions.
Reading a file with Convert EOL true will change the CR,LF, CRLF, LFCR
combinations into singles LF in the read string.
Writing a string to file with Convert EOL true will change them back to the
platform dependant end-of-line charater(s).

Jean-Pierre Drolet

"Michael Aivaliotis" a �crit dans le message news:
NEBBLMHKNDMEHNKLDKBBMEOCCBAA.michael@cymasoft.com...
> Sorry, it returns an empty string..
> Actually the solution to your problem comes from somewhere else.
>
> What you have to do is find out what an "End of Line" constant looks like
on
> each platform.
>
> If the "End of Line" constant is equal to a "Carriage Return" constant
then
> you have a Mac.
> If the "End of Line" constant is equal to a "Line Feed" constant then you
> have Unix.
> If the "End of Line" constant is equal to a "Carriage Return" constant
> concatenated with a "Line Feed" constant then you have a PC or a "Gates
> Box".
>
> Everything else is Unknown platform. I wonder what Linux returns....Hmmmm.
>
> Thank You
>
> Michael Aivaliotis
> Senior Developer
> Cymasoft Inc.
> Tel: 416.984.9100
> email: michael@cymasoft.com
> web: www.cymasoft.com
>
>
> > -----Original Message-----
> > From: stepheb@comm.mot.com [mailto:stepheb@comm.mot.com]
> > Sent: Friday, October 20, 2000 10:46 AM
> > To: comp.lang.labview@list.deja.com
> > Subject: Re: How to tell your platform type?
> >
> >
> > Message from the Deja.com forum:
> > comp.lang.labview
> > Your subscription is set to individual email delivery
> > This message was sent to michael@cymasoft.com
> > Deja.com: Best way to buy a PC
> > http://www.deja.com/channels/channel.xp?CID=13031
> > >
> > Can someone on a windows platform do an experiment? The "empty path"
> > constant, when routed to a path to string converter, returns the
> > empty string
> > for Macintosh and a forward slash for unix. I'm hoping that it
> > will return a
> > backwards slash for windows.
> >
> > Thanks.
> >
> > -- Stephen
> > who is still using labview 4.1
> >
> >
> > Paul Davey wrote:
> >
> > > Hi Stephen
> > >
> > > I asked this question once. You use the "Open Application Reference"
> > > function (Application Control) (with no inputs) and wire the reference
> > > number to a "Property Node". Then pop up on the element in the
Property
> > > Node and choose "Operating System: Name"
> > >
> > > Paul
> > > --
> > >
> > > Research Assistant
> > > School of Physiotherapy, Curtin University of Technology
> > > Selby Street, Shenton Park, Western Australia, Australia. 6008
> > > email: P.C.Davey@curtin.edu.au
> > > Tel. +61 8 9266 4657 Fax. +61 8 9266 3699
> > >
> > > "Everyone who calls on the name of the Lord will be saved." Romans
10:12
> > > "For all have sinned and fall short of the glory of God, and
> > are justified
> > > freely by his grace through the redemption that came by Christ Jesus."
> > > Romans 3:23-4
> > >
> > > Stephen Boulet wrote:
> > >
> > > > I'd like to be able to tell the platform type (unix, mac,
> > windows) that
> > > > a VI is running on so that I can better parse text files. Does
anyone
> > > > know of a nice way to do this?
> > > >
> > > > -- Stephen
> >
> > --
> > Stephen Boulet
> > Senior Electrical Engineer
> > Schaumburg BTS COE Lab
> > Motorola Network Solutions Sector
> > Phone: 847-576-4399
> > Fax: 847-538-3765
> >
> >
> >
> >
> >
> >
> > _____________________________________________________________
> > Deja.com: Before you buy.
> > http://www.deja.com/
> > * To modify or remove your subscription, go to
> > http://www.deja.com/edit_sub.xp?group=comp.lang.labview
> > * Read this thread at
> > http://www.deja.com/thread/%3C39F05AB9.4F66DCD2%40comm.mot.com%3E
> >
> >
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
0 Kudos
Message 8 of 9
(3,294 Views)
If you open the 'Snd Play Wave File.vi' in Function >> Graphics and Sound
>> Sound pallete, and then look at the diagram, it will show exactly how
to do this.

"Michael Aivaliotis" wrote:
>Sorry, it returns an empty string..>Actually the solution to your problem
comes from somewhere else.>>What you have to do is find out what an "End
of Line" constant looks like on>each platform.>>If the "End of Line" constant
is equal to a "Carriage Return" constant then>you have a Mac.>If the "End
of Line" constant is equal to a "Line Feed" constant then you>have Unix.>If
the "End of Line" constant is equal to a "Carriage Return" constant>concatenated
with a "Line Feed" constant then you have a PC or a "Gates>Box".>>Everything
else is Unknown platform. I wonder what Linux returns....Hmmmm.>>Thank You>>Michael
Aivaliotis>Senior Developer>Cymasoft Inc.>Tel: 416.984.9100>email: michael@cymasoft.com>web:
www.cymasoft.com>>>> -----Original Message----->> From: stepheb@comm.mot.com
[mailto:stepheb@comm.mot.com]>> Sent: Friday, October 20, 2000 10:46 AM>>
To: comp.lang.labview@list.deja.com>> Subject: Re: How to tell your platform
type?>>>>>> Message from the Deja.com forum:>> comp.lang.labview>> Your
subscription is set to individual email delivery>> This message was sent
to michael@cymasoft.com>> Deja.com: Best way to buy a PC>> http://www.deja.com/channels/channel.xp?CID=13031>>
>>> Can someone on a windows platform do an experiment? The "empty path">>
constant, when routed to a path to string converter, returns the>> empty
string>> for Macintosh and a forward slash for unix. I'm hoping that it>>
will return a>> backwards slash for windows.>>>> Thanks.>>>> -- Stephen>>
who is still using labview 4.1>>>>>> Paul Davey wrote:>>>> > Hi Stephen>>
>>> > I asked this question once. You use the "Open Application Reference">>
> function (Application Control) (with no inputs) and wire the reference>>
> number to a "Property Node". Then pop up on the element in the Property>>
> Node and choose "Operating System: Name">> >>> > Paul>> > -->> >>> > Research
Assistant>> > School of Physiotherapy, Curtin University of Technology>>
> Selby Street, Shenton Park, Western Australia, Australia. 6008>> > email:
P.C.Davey@curtin.edu.au>> > Tel. +61 8 9266 4657 Fax. +61 8 9266 3699>>
>>> > "Everyone who calls on the name of the Lord will be saved." Romans
10:12>> > "For all have sinned and fall short of the glory of God, and>>
are justified>> > freely by his grace through the redemption that came by
Christ Jesus.">> > Romans 3:23-4>> >>> > Stephen Boulet wrote:>> >>> > >
I'd like to be able to tell the platform type (unix, mac,>> windows) that>>
> > a VI is running on so that I can better parse text files. Does anyone>>
> > know of a nice way to do this?>> > >>> > > -- Stephen>>>> -->> Stephen
Boulet>> Senior Electrical Engineer>> Schaumburg BTS COE Lab>> Motorola Network
Solutions Sector>> Phone: 847-576-4399>> Fax: 847-538-3765>>>>>>>>>>>>>>
_____________________________________________________________>> Deja.com:
Before you buy.>> http://www.deja.com/>> * To modify or remove your subscription,
go to>> http://www.deja.com/edit_sub.xp?group=comp.lang.labview>> * Read
this thread at>> http://www.deja.com/thread/%3C39F05AB9.4F66DCD2%40comm.mot.com%3E>>>>>>>>
Sent via Deja.com http://www.deja.com/> Before you buy.
0 Kudos
Message 9 of 9
(3,294 Views)
Yes. If you go to your diagram, place the Application Control -> Open
Application Reference VI on your diagram. Next, place the Application
Control -> Property Node VI on your diagram. Wire the application
references together. One of the properties of the property node should
then be Operating system -> Name, and that will give you a string output
of the operating system, i.e. Windows 95, Windows NT, etc.

You can use that to select how you retrieve files from the system.

Don't forget to close the application reference with an Application
Control -> Close Application Reference VI.

Mark

In article <39EE1393.9B3BCAD0@comm.mot.com>,
stepheb@comm.mot.com wrote:
> I'd like to be able to tell the platform type (unix, mac, windows)
that
> a VI is running
on so that I can better parse text files. Does anyone
> know of a nice way to do this?
>
> -- Stephen
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 6 of 9
(3,294 Views)