Repeating a function continuously and control a device (RS 232)
neovenecia
Sun, 07/08/2018 - 05:54 am
Hello
I am new to Igor Pro and need to programm a software to control a new self made device with a relay card.
I hope you can help me.I already watched the guide me tour and the tutorial videos.
A major part of my software is to check continuously if the current measured value of an measuring instrument (last value saved in a global variable) matches the value range which I set before.
By problem is to find a way that the software checks this each second. Is there a built. Is there built-in function to repeat a function with a fixed interval?
My next issue is how to control a realy card which is connected by a RS-232 serial port. I am not sure how to approch this and am glad for advide where to read more about it. Because in the manual I only read about data aquisition.
Thank you in advance for your help.
July 8, 2018 at 06:49 am - Permalink
DisplayHelpTopic "VISA XOP"
July 8, 2018 at 09:54 am - Permalink
July 9, 2018 at 03:15 am - Permalink
STRUCT WMBackgroundStruct &s
Printf "Task %s called, ticks=%d\r", s.name, s.curRunTicks
return 0 // Continue background task
End
Function StartTestTask()
Variable numTicks = 2 * 60 // Run every two seconds (120 ticks)
CtrlNamedBackground Test, period=numTicks, proc=TestTask
CtrlNamedBackground Test, start
End
Function StopTestTask()
CtrlNamedBackground Test, stop
End
July 9, 2018 at 08:30 am - Permalink