ControlDesk Automation in dSpace

Crispen cjb111 at student.canterbury.ac.nz
Sun May 29 05:08:05 EDT 2005


I am having trouble using the ControlDesk automation libraries in
python. In particluiar running the automation in a thread. My code is
as follows, is keeps coming up with this strange error. Any help would
be great.

Crispen

import cdacon
from time import sleep
from cdautomationlib import *

def Auto():
   sleep(0.5)
   # triggering://dSPACE NumericInput Control_1:WriteData
   Instrumentation().ConnectionController.DisableSystemPoll()
   Instrumentation().Layouts.Item("c:\\users\\matlab
files\\triggering.lay").Instruments.Item("dSPACE NumericInput
Control_1").Value = 1.0000000000000000
   Instrumentation().ConnectionController.ProcessAnimationEvent
("triggering://dSPACE NumericInput Control_1","WriteData")
   Instrumentation().ConnectionController.EnableSystemPoll()
   sleep(0.5)
   # triggering://dSPACE NumericInput Control_1:WriteData
   Instrumentation().ConnectionController.DisableSystemPoll()
   Instrumentation().Layouts.Item("c:\\users\\matlab
files\\triggering.lay").Instruments.Item("dSPACE NumericInput
Control_1").Value = 0.00000000000000000

Instrumentation().ConnectionController.ProcessAnimationEvent("triggering://dSPACE
NumericInput Control_1","WriteData")
 Instrumentation().ConnectionController.EnableSystemPoll()
   sleep(0.5)
   # triggering://dSPACE NumericInput Control:WriteData
   Instrumentation().ConnectionController.DisableSystemPoll()
   Instrumentation().Layouts.Item("c:\\users\\matlab
files\\triggering.lay").Instruments.Item("dSPACE NumericInput
Control").Value = 1.0000000000000000
   Instrumentation().ConnectionController.ProcessAnimationEvent
("triggering://dSPACE NumericInput Control","WriteData")
   Instrumentation().ConnectionController.EnableSystemPoll()
   sleep(0.5)
   # triggering://dSPACE NumericInput Control:WriteData
   Instrumentation().ConnectionController.DisableSystemPoll()
   sleep(0.5)
   Instrumentation().Layouts.Item("c:\\users\\matlab
files\\triggering.lay").Instruments.Item("dSPACE NumericInput
Control").Value = 0.00000000000000000

Instrumentation().ConnectionController.ProcessAnimationEvent("triggering://dSPACE
NumericInput Control","WriteData")
   Instrumentation().ConnectionController.EnableSystemPoll()
   sleep(0.5)
   Instrumentation().Layouts.Item("c:\\users\\matlab
files\\triggering.lay").Activate()
   sleep(0.5)
   Instrumentation().Layouts.Item("c:\\users\\matlab
files\\triggering.lay").Activate()


thread.start_new_thread(Auto,())




More information about the Python-list mailing list