10-13-2016 03:53 AM - edited 10-13-2016 03:55 AM
Here you are.
10-13-2016 07:37 AM
Why make it so difficult to help you? Upload the VI, and the VI that calls this one that shows how you update the address global variable, and also show us your real C code.
10-13-2016 07:59 AM - edited 10-13-2016 08:07 AM
Thanks for your help. I could post all my code but it will be huge.
10-13-2016 10:55 AM - edited 10-13-2016 10:55 AM
Do you have any control over where the initial set of images are stored? If you could store them in consecutive addresses - one immediately after the other - then you could do a single MoveBlock call rather than loop through all the addresses. I don't know if this would be much faster.
10-13-2016 11:43 AM - edited 10-13-2016 11:51 AM
Well,there is absolutely no reason to set the Call Library Node to execute in the UI thread. MoveBlock() is a self contained function that has no global state that is shared with itself or anyone else. So change the Call Library Node to execute in any thread and after that when you really want to go crazy you can also enable parallel execution on the loop. That should definitely give you a performance boost to the point that doing this in C will be actually slower unless you start to go multithreading in C too.
in case you wonder how you can know if a LabVIEW manager function is multithreading compatible or not: Take a look at the extcode.h file in the cintools directory inside the LabVIEW directory. All functions in there have a preprocessor definition in front of them.
If the function is TH_REENTRANT it is completely safe to call the function from any thread. If it is TH_PROTECTED it could be safe but you must make sure that you do not call the same function in parallel otherwise it could result in mutex locks (the code simply hangs and you can not get out if it other than resetting the whole process). If it is TH_SINGLE_UI or TH_UNSAFE you absolutely have to call it from the UI thread to be safe.
10-13-2016 03:13 PM
Many thanks for your feedbacks. I will check this in a few days and keep you updated. Again, many thanks