LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

comment optimiser la vitesse de création d'un tableau

Bonjour a tous,

je développe actuellement une interface qui doit me permettre de lire et envoyer des trames CAN. sauf que le programme doit pouvoir lire au moins 800 trames CAN et qu'il est très lent pour le faire. Quelqu'un serait-il comment aller plus vite. Je fournis un extrait de mon code.

Pour infos la réception de la trame CAN se fait avec les fichier PCANBasic.h de Peak.

 

Merci d'avance.

0 Kudos
Message 1 of 3
(1,190 Views)

You are entirely creating the table from scratch, but some operations can probably be saved to avoid wasting execution time. Definition of columns is probably constant across all frames, so if you prepare an empty table with all necessary columns already customized as per data type, precision and so on you will save some operations.

 

Having said this, the normal way to speed up table operations is to hide it before updating it and show it afterwards, but I don't know if it can be feasible in your application. Another tip is to use SetTableCellAttribute (..., ..., ..., ATTR_CTRL_VAL, ...) instead of SetTableCellVal (). All these hints are aimed to defer actual screen update since it is a known bottleneck: if you need to keep the user informed of process development you may add some ProcessDrawEvents () at slow intervals



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 3
(1,175 Views)

thank you for answer

0 Kudos
Message 3 of 3
(1,103 Views)