DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Script driver performance issues

Hello together,

I am still working on my DIAdem project, in wich I want to use a serial output while reaching a certain limit value of a channel during measurement.

 

I got my script output working for initialisation. The hardware connected receives the sent serial trigger character while the setup part of my script output is run.

With a simple if-condition in the script driver I want to use the driver while measuring. But there are some problems. The measurement is slowing down drasticly if the trigger is working(ten times slower or more). Is that what I should expect from using this method for this purpose? Or do I do something wrong here?  

'------------------------------------------------------
Dim oSerialPort

'Initialize COM port
Sub SFD_Init(DeviceParam1V, DeviceParam2V, ErrorP )
  'Open and initialize object
   Set oSerialPort =CreateUDI("Hallo" ) 
  'open the serial port (COM5)
  Call oSerialPort.Open("COM", "COM5")
  'Set the baud rate (here 9600 baud)
  Call oSerialPort.ParamSet( "BAUDRATE","9600")
  Call  SFD_Write()
End Sub

'Signal Output
Sub SFD_Write()
   Call oSerialPort.Write(1) 
End Sub

'Needs this sub
Sub SFD_WriteChannel( ChannelNumberP, ParamP, DataP, DoneP, ErrorP) 
	if p_kSAS > -0.1 Then 
	Call SFD_Write()
	End If
DoneP = 1
End Sub


'Error
Sub SFD_DeInit(ErrorP)
  'Close the COM port
  oUDIM.Close()
  'Release the UDI object
  Set oUDIM = Nothing
End Sub

Sub SFD_DeInit(ErrorP) 
  'Close port
  oSerialPort.Close() 
  'Delete object
  Set oSerialPort= Nothing
End Sub

DAC_Einstellungen.PNG

 

DAC_LI.jpg

Thanks for help!

0 Kudos
Message 1 of 1
(2,217 Views)