LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

data change with digital multi-meter

Solved!
Go to solution

this is NI7SegMetaFont numeric, and can it change with my multi-meter through RS-232 comport as the video data changes? thanks

Snipaste_2019-04-05_15-23-30.jpg

0 Kudos
Message 1 of 6
(2,179 Views)
Solution
Accepted by topic author whily

Hello whily,

this is not a question with a fast and  easy answer. Supposing this one is the instrument you want to replicate on the PC screen, the solution implies several steps:

 

  • Download the full instrument documentation if you haven't done it already; locate the manual where the communications protocol is described
  • Learn some basics of RS232 communications in CVI if you haven't done it already. You can also look at serial comms examples that come with the IDE
  • Connect to the instrument with a proper cable, detect the communications parameters (baud rate, data bits, stop bits, parity, handshake)
  • Start opening the com port and check the communications works well with a basic command (the user manual has some basic procedure to test the communication)
  • Proceed developing your app adding functions to configure and read the instrument as per your requirements

 

We will be happy to help you solving some problem in the process, but you will need to go through the above steps before we can help you effectively.



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 2 of 6
(2,165 Views)

Maybe there is an easy way to solve it.

like set a timer and send "Get Value" command every 1.0 second.

this is sensible, but I don't know how to use a timer.

Need I set a timer callback or something else.

Thanks!

0 Kudos
Message 3 of 6
(2,145 Views)
Solution
Accepted by topic author whily

This appears as a solution for the last item in the list!

Provided all the previous steps are checked and working yes, a timer (as well as an async timer or a separate thread) is a way of mirroring instrument measures to PC screen.

Using a timer can be as simple as adding a timer control to a panel on the UI, adding a callback to it and putting instrument control functions in the timer callback. You can search for timer examples among the sample code installed on your system, bat basically the crucial thing in using a timer is to keep the timer callback as fast as possible to avoid interfering with other parts of the application (e.g. handling user events on UI controls). Also, do not forget that the timer callback is an asynchronous event: that is you must protect shared resources from concurrent access by the timer and other events; moreover, a variable or control value can be modified inside the timer callback in every moment, so you must be careful in how to access them from other parts of the application.



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 4 of 6
(2,141 Views)

After I use the function timer, my program becomes very laggy even if when I click the off button.

 

But when I set a larger timer interval, it becomes not so laggy. why is this, and how can I solve it except set a larger timer interval?

 

Thanks!

0 Kudos
Message 5 of 6
(2,126 Views)

I don't like to play the "guess what" game: post you code so that we can look at it.

In the meanwhile try answering this questions: how long does the timer callback lasts? And what is the timer interval? 



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 6 of 6
(2,118 Views)