Hallo,
ich versuche ein Ausgabe-Plugin für die DAS-Light dll zu schreiben. Leider ist es mir mir bis jetzt noch nicht gelungen, die DMXC Ausgabebeispiele in VB 2008 Express oder VC 7.1 (2003) erfolgreich zu erstellen. Kann mir eventuell jemand ein Beispielprojekt für ein Ausgabe-Plugin in einer dieser beiden Versonen zukommen lassen?
Als Alternative würde ich mich auch freuen, wenn jemand das Plugin erstellen würde.
Dazu müßten folgende globale Konstanten und Variablen definiert werden:
' DAS constants & globals
Public Const DMXCHANNELS As Short = 512
Public Const DHC_INIT As Short = 9 ' COMMAND
Public Const DHC_EXIT As Short = 10 ' COMMAND
Public Const DHC_OPEN As Short = 1 ' COMMAND
Public Const DHC_CLOSE As Short = 2 ' COMMAND
Public Const DHC_DMXOUTOFF As Short = 3 ' COMMAND
Public Const DHC_DMXOUT As Short = 4 ' COMMAND
Public dmxdata(512) As Byte
Public hardware_ok As Short
Public result As Short
Public Declare Function DasUsbCommand Lib "DasHard2006VB.dll" (ByVal new_command As Integer, ByVal param As Integer, ByRef dmxdata As Byte) As Short
In der Enable Methode wäre folgender Code einzufügen:
' DAS interface init
Dim i As Object
For i = 1 To DMXCHANNELS
dmxdata(i) = 0
Next i
hardware_ok = DasUsbCommand(DHC_INIT, 0, 0)
hardware_ok = DasUsbCommand(DHC_OPEN, 0, 0)
If hardware_ok > 0 Then
MsgBox("Interface: found")
' Im Interface alle Werte auf 0 setzen
result = DasUsbCommand(DHC_DMXOUTOFF, 0, dmxdata(1))
Else
MsgBox("Interface: not found")
End If
In der Disable Methode:
'DAS interface close
If hardware_ok > 0 Then
result = DasUsbCommand(DHC_CLOSE, 0, 0)
result = DasUsbCommand(DHC_EXIT, 0, 0)
End If
In der Methode IDMXCPlugin_MessageHandle:
Select Case Msg
Case MSG_Channel_Send
If Arg1 >= 1 And Arg1 <= DMXCHANNELS Then
' DMX-Wert im Array aktualisieren
' Arg1 ist channel, Arg2 ist Wert
dmxdata(Arg1) = Arg2
End If
End Select
Die Ausgabe zum Interface sollte in einem Timer mit ca. 50 ms erfolgen:
If hardware_ok > 0 Then
result = DasUsbCommand(DHC_DMXOUT, DMXCHANNELS, dmxdata)
End If
Sollte noch etwas unklar sein, bitte mich fragen.