LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

InstallComCallback

Solved!
Go to solution

Bonjour,

Désolée si cette question a déjà été posée mais je suis en train de décotiquer un bout de coder écrit sur CVI et il y a quelques notions qui m'échappent. Aussi je me pose la quetsion sur le rôle de la fonction "InstallComCallback" . D'après ce que j'ai compris, elle permet d'accéder au port série, est-ce bien cela?

Merci d'avance pour votre réponse.

Bien cordialement,

Tok

0 Kudos
Message 1 of 7
(5,604 Views)

Sorry for answering in English, I don't speak French. I used Google translate to understand your question, so if Im' wrong please repost it in English or alternative use the French board.

 

InstallComCallback installs a function that is called when certain events are raised on the serial port. It is just one of the possible event handling methods you can use, not necessarily the best one depending on the type of device attached or the caracteristics of the conversation you need to implement.

CVI help describes throughly the function and there are examples to see how to use it in the samples folder: you can find them by means of the Example Finder (Help >> Find examples... menu item).



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 7
(5,596 Views)

can using thread with specific delays (depending upon data refresh rate) will be more useful than installcomcallback ??

0 Kudos
Message 3 of 7
(5,495 Views)

There isn't a definitive answer to the original question: it depends on which type of communications you need to implement. The original question from Tok was not detailed enough to evaluate if and how InstallComCallback would be better that other structures.



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 4 of 7
(5,484 Views)

sir please guide me if and how InstallComCallback would be better that other structures ??

0 Kudos
Message 5 of 7
(5,460 Views)
Solution
Accepted by topic author tokina

Well, it's not easy to depict a situation in which it is better than other methods. I can tell you when InstallComCallback cannot be easily used instead.

 

Supposing you have variable-lenght messages and different message termination (e.g. because you are talking to different instruments) or no termination at all, you cannot esily implement reception via a com callback. It could be done intercepting every single character ane queing it up to build up the message, but question is: is your situation worth the effort?

Additionally, InstallComCallback introduces some level of complexity since getting the response is made asynchronously in a separate callback from the writing one, so you need to sync both functions some way.



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 6 of 7
(5,449 Views)

Merci les amis d'avoir pris le temps de me répondre ! 🙂 thank you very much ! Cat Happy

0 Kudos
Message 7 of 7
(5,181 Views)