LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

outp(), the revenge...

hi people!

   It seems to me that in my older LabWindows (7.0) I wasn't allowed to use outp() function, because of the windows xp security fix (to avoid user program directly access to ports).  Now, in LabWindows 7.1, I can run a program containing outp(), and I'm capable to write to the serial port (incredible...). 

   I'd like to know if NI fixed this problem, I mean, if I compile an application using LabWindows 7.1, can I be sure of avoiding the well known run-time error when I try to perform a port write (in other windows too, say NT, and so on....)?

  thanks!

graziano
0 Kudos
Message 1 of 5
(3,551 Views)
I do not know if this is the result of some NI update in CVI or of the Fabulous Windows Update ( Smiley Surprised ) or of the Law of Undeterministic Behaviour of Windows OS ( Smiley Very Happy ), but consider that, according to documentation,
 
If you specify a negative value for outputQueueSize, the output queue is not used and the data is written to the port directly
 
This should have the same effect of using outp on the serial port. At least, some application I have written in the past using outp has been converted to standard ComWrt with no negative effects after setting output queue size = -1.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 5
(3,545 Views)
We have this:
  

outp

char outp(int portNumber, char byteToWrite);

Purpose

Writes a byte to a port.


Note    On Windows 2000/NT, outp requires the LabWindows/CVI low-level support driver. LabWindows/CVI loads the driver at startup if it is on disk. You can check whether LabWindows/CVI loaded the driver at startup by calling CVILowLevelSupportDriverLoaded.


I think this time it doesn't concern Windows update!  Normally, in Posix I think, outp() is a "raw" function, that doesn't rely on any special driver. If you use a simple outp() (or inp()...) within another compiler, you'll get errors at runtime in windows NT, 2000, XP (not in 95, 98...). 

Bye.

graziano 
0 Kudos
Message 3 of 5
(3,540 Views)


For NT, 2K and XP  we created a low level driver that allows users access to low level devices. This was additional functionality we had to add to make sure the function still worked in these OSs. I'm not sure what problem you ran into with outp(), I have not heard of that one before.



Bilal Durrani
NI
Message 4 of 5
(3,509 Views)
Hi Bilal,
   thanks a lot, now I understand!  I suppose I should include "Low level upport driver" in my distribution kits, if I want to use outp(), inp(), etc....

   Thanks again!

graziano
0 Kudos
Message 5 of 5
(3,500 Views)