LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to the System clipboard

This company uses LabVIEW 2012 and LabWindows 2010 in an Aerospace environment. The use of older versions is done to have commonality with their facilities across the globe. Thus, I cannot get them to upgrade.

 

On their new test station, they have 14 serial ports to communicate with the unit under test. I have developed a LabVIEW serial port interface program that will allow them to communicate with those serial ports. I have the ini file configured to allow the user to run multiple instances of the executable, for as many ports as they desire, during their testing. One option that they requested is the ability to right click the mouse, have a menu display to select copy or copy all of the data to the clipboard so that they can paste the received data into a test report. I used the LabVIEW App Invoke Node function Write to Clipboard and Read From Clipboard to perform the task. However, I have the issue that this works on some instances and does not work on other instances of the executables. Since the code is the same, the user enters which port to connect to, I do not understand why I have this issue. It works fine on my PC which only has a single COM port.

 

I decided to write two LabWindows functions to read and write to the clipboard using ClipboardGetText and ClipboardPutText. I call those dll functions from LabVIEW. The first call to the function ClipboardPutText works in the sense that the data is placed into the clipboard. However, I immediately get a fatal error and the process stops. (I did not save a screen image and the test stations are in use at this time). After that, none of the other instances will copy the data and they all result in a fatal error and stop. This is repeatable as I restarted the software numerous times as I tried to determine the cause.

 

Since I do not have access to the code for the clipboard functions, I cannot determine if I need to configure something else related to the clipboard or the process attempting to read/write from/to the clipboard. I will continue to search but wanted to ask the experts in control of the clipboard software to determine if they have any recommendations on what may need to be added.

 

For LabWindows, the only other call that I performed was a free command after I executed the ClipboardGetText, if the pointer to the text was not NULL.

 

I will post this in both the LabVIEW and LabWindows discussion boards in case one or the other has a solution.

 

Thank you for your help.

 

I can provide a zip file, containing the source code, to NI personnel if you provide an email address. Since I am a contractor, I am not sure if the company’s policy allows global posting of their code, although I may be able to reduce the code to a minimum example, if necessary.

0 Kudos
Message 1 of 7
(4,568 Views)

Crash Reports

Download All
0 Kudos
Message 2 of 7
(4,563 Views)

The preceding post has nothing to do with the argument of this threas or with NI world at all. Notified to moderator.



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?
0 Kudos
Message 3 of 7
(4,502 Views)

Roberto - I did so as well - but I think that once the inappropriate post is removed by an operator your comment will be misleading because then "preceding" will refer to a legal post... Hence I think that a report to the operator alone may be better Smiley Wink

0 Kudos
Message 4 of 7
(4,499 Views)

Let's see what happens: I seem to remember that I did this way other times and they removed both the offending posts and my ones. My idea is to avoid mods to be notified several times for the very same post, maybe I'm just worrying to much about this Smiley Happy



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?
0 Kudos
Message 5 of 7
(4,496 Views)

Hi Bill,

 

Please see the other post for some suggestions.

Julia P.
Message 6 of 7
(4,464 Views)

Thanks for your help.

 

The NI (National Instruments) software works correctly. The problem revolved around the developers of the software, for the unit under test, not initializing all of the ports exactly the same. They gave me some excuse for doing that which I just ignored. Anyway, the ports with the problem would transmit one or two NULL bytes when the unit had power applied because they were not initialized the same as the ports that worked, if at all. I ended up putting a filter in my code to analyzed the string replacing any NULLs with an asterisk. That resolved the issue.

 

Is there a way to give negative Kudos to certain individuals?

0 Kudos
Message 7 of 7
(4,409 Views)