07-06-2015 04:31 AM
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
Solved! Go to Solution.
07-06-2015 05:23 AM
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).
07-14-2015 01:48 AM
can using thread with specific delays (depending upon data refresh rate) will be more useful than installcomcallback ??
07-14-2015 02:55 AM
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.
07-16-2015 01:06 AM
sir please guide me if and how InstallComCallback would be better that other structures ??
07-16-2015 02:43 AM
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.
09-23-2015 04:48 AM
Merci les amis d'avoir pris le temps de me répondre ! 🙂 thank you very much !