LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Com ports

I've made a program that talks with a device through comport.
To be able to do this the labview program first runs a small dos
program that tells the device to get ready. (I cant do this in
labview). This dos program window automaticly closes afterwards.

Because of other programs in background are having some weird bugs
which locks up the comport (without using it) I have to set
COM1AutoAssign=0
(which makes all programs able to access the comport (at the same
time)).

Now how do i set labview to know that the dos program is finished
without sending any data to the comport? (if sending data to comport
to check if device is ready the dos program of course will fail)

Is there any easier function (in labview) to search what applications
that is open? like task m
anager does.. etc

Big thanks in advance!
/ape
0 Kudos
Message 1 of 5
(3,431 Views)
I'm assuming that you're using System Exec to run the DOS program. The function has an input called wait until completion. The default is True. If you've wired a False to it, change it and the function will not return until the exe you're called has finished.

I'm also curious to know what it is about the device that you can't do in LabVIEW and have to do in DOS.
0 Kudos
Message 2 of 5
(3,431 Views)
Dennis Knutson wrote in message news:<506500000005000000E7C40000-1042324653000@exchange.ni.com>...
> I'm assuming that you're using System Exec to run the DOS program. The
> function has an input called wait until completion. The default is
> True. If you've wired a False to it, change it and the function will
> not return until the exe you're called has finished.

Yes system exec.
Ah, yes.. I tried "wait until completion". But I never got it to work
which is the reason why i dont use it. Actually labview crashed each
time i put it on TRUE. I tried again right now.. and it crashed. (The
dos program comes up but nothing happens!, Cant close the dos program
or labview. Labview then says "resetting VI: xxxxxx.vi" but nothing
happens and i have to close both program through task manager.) What
am I doing wrong???

I found the solution to this problem though. (To see if dos program is
closed)
A pack of windows utilities for labview can be downloaded from NI
site. One of them returns an array of all open apps/windows. Which i
do once a second or so until the string (name of app) cannot be found.
This works good also.

> I'm also curious to know what it is about the device that you can't do
> in LabVIEW and have to do in DOS.

Its a compiled exe which uploads necessary data to device.
It also shows how much percentage thats been uploaded.
Is there any way to integrate this in labview i would be very happy!

Other question:
system.ini
[386Enh]
'No line' (which is the same as COM1Autoassign=-1 ?) don't work,
because of other badly coded programs running in background
(necessary though)
COM1AutoAssign=0 worked. (of course as long as only one program access
comport at one time.)
COM1AutoAssign=2 worked also! (2=The port is released after two
seconds of inactivity (correct?)) But i thought that it wouldnt work
because when dos program is closed labview directly tries to access
the port. But in that case there isnt two seconds of inactivity on
port which needed for release the port, or am i wrong here? And I dont
even think it takes two seconds when switching com1 from dos program
to labview.

Thanks in advance!
/ape
0 Kudos
Message 3 of 5
(3,431 Views)
Hi,

My guess is you have to increase the expected output size. The dos
application uses this memory to write in, and if it's too small, strange
things can happen.

Regards,

Wiebe.

"apemoonkey" wrote in message
news:87533a6d.0301170135.a1e3cfe@posting.google.com...
> Dennis Knutson wrote in message
news:<506500000005000000E7C40000-1042324653000@exchange.ni.com>...
> > I'm assuming that you're using System Exec to run the DOS program. The
> > function has an input called wait until completion. The default is
> > True. If you've wired a False to it, change it and the function will
> > not return until the exe you're called has finished.
>
> Yes system exec.
> Ah, yes.. I tried "wait until completion". But I never got it to work
> which is the reason why i dont use it. Actually labview crashed each
> time i put it on TRUE. I tried again right now.. and it crashed. (The
> dos program comes up but nothing happens!, Cant close the dos program
> or labview. Labview then says "resetting VI: xxxxxx.vi" but nothing
> happens and i have to close both program through task manager.) What
> am I doing wrong???
>
> I found the solution to this problem though. (To see if dos program is
> closed)
> A pack of windows utilities for labview can be downloaded from NI
> site. One of them returns an array of all open apps/windows. Which i
> do once a second or so until the string (name of app) cannot be found.
> This works good also.
>
> > I'm also curious to know what it is about the device that you can't do
> > in LabVIEW and have to do in DOS.
>
> Its a compiled exe which uploads necessary data to device.
> It also shows how much percentage thats been uploaded.
> Is there any way to integrate this in labview i would be very happy!
>
> Other question:
> system.ini
> [386Enh]
> 'No line' (which is the same as COM1Autoassign=-1 ?) don't work,
> because of other badly coded programs running in background
> (necessary though)
> COM1AutoAssign=0 worked. (of course as long as only one program access
> comport at one time.)
> COM1AutoAssign=2 worked also! (2=The port is released after two
> seconds of inactivity (correct?)) But i thought that it wouldnt work
> because when dos program is closed labview directly tries to access
> the port. But in that case there isnt two seconds of inactivity on
> port which needed for release the port, or am i wrong here? And I dont
> even think it takes two seconds when switching com1 from dos program
> to labview.
>
> Thanks in advance!
> /ape
0 Kudos
Message 4 of 5
(3,431 Views)
ah, thanks for your tip!
Good tip but unfortunately it didnt work 😞
I raised first to 10000 (no difference) and 1000000000 (still no difference)
hmmm
i spoke to a friend.. he recognized the problem.. but didnt remember the solution


"Wiebe@AIR" wrote in message news:<3e280365$0$94297$e4fe514c@dreader4.news.xs4all.nl>...
> Hi,
>
> My guess is you have to increase the expected output size. The dos
> application uses this memory to write in, and if it's too small, strange
> things can happen.
>
> Regards,
>
> Wiebe.
0 Kudos
Message 5 of 5
(3,431 Views)