Hi,
ist es möglich auf einem Frontpanel eine "Radio-Button-Group" zu definieren?
Ich schalte mit mehreren Schaltern einzelne Bits um, die nicht gleichzeitig gesetzt sein sollen.
Mfg Technikadonis
Radio-Buttons
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Radio-Buttons
Hier ein PE5 VBS Macro das die Rocker-Switch simuliert. Das komplette PE5 Projekt (UserPanel wird benötigt) liegt im Anhnag des Post zum herunterladen.
Code: Select all
'------------------------------------------------------------------------------
'FILE DESCRIPTION: A description was not provided.
'------------------------------------------------------------------------------
Sub SiemensRockerSwitchTest()
'DESCRIPTION: Sample macro to send a sinus signal
If Not Connections(1).IsEnabled Then
MsgBox "Please enable the TestNet connection!",,"Error"
PrintToOutputWindow "Please enable the TestNet connection!"
Exit Sub
End If
Dim StopSig, SW1, SW2, SW3
' Get the stop signal, which is set by the Stop button in the panel
Set StopSig = Signals("Stop")
StopSig.Value = 0
Set SW1 = Signals("Switch1")
SW1.Value = 1
Set SW2 = Signals("Switch2")
SW2.Value = 0
Set SW3 = Signals("Switch3")
SW3.Value = 0
If StopSig Is Nothing Then
MsgBox "Signal not found!" & vbCrLf & _
"Please make sure that the file Test-Symbol.sym is assigned to the TestNet connection.",, _
"Error"
PrintToOutputWindow "Please make sure that the file Test-Symbol.sym is assigned to the TestNet connection."
Exit Sub
End If
' Run the "Highlander Switch"
Do While StopSig.Value = 0
if SW1.Value = 1 Then
SW2.Value = 0
SW3.Value = 0
PrintToOutputWindow "Drive aktiv"
wait 300
end if
if SW2.Value = 1 Then
SW1.Value = 0
SW3.Value = 0
PrintToOutputWindow "Neutral aktiv"
wait 300
end if
if SW3.Value = 1 Then
SW1.Value = 0
SW2.Value = 0
PrintToOutputWindow "R³ckwõrts aktiv"
wait 300
end if
Loop
PrintToOutputWindow "Stop pressed"
' Stop button was pressed!
End Sub
- Attachments
-
- Rocker-Test.zip
- PE5 Project für Rocker Switch Test
- (4.07 KiB) Downloaded 420 times
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
-
- Posts: 2
- Joined: Thu 4. Oct 2012, 21:45
Re: Radio-Buttons
Hallo Herr Wilhelm,
vielen Dank für die Antwort, nachdem ich das Makor endlich gestartet hatte, funktionieren die Rocker-Switchs.
Jetzt stehe ich aber anscheinend noch auf der Leitung, wie ich mit diesen Switchs "Signale" aus einem Sym-File beeinflusse, sodass der Zustand der Switchs auf dem CAN übertragen wird.
Muss ich hierfür in der "Do While"-Schleife statt "PrintToOutputWindow" einen Befehl zum Absetzen einer CAN-Nachricht ausführen?
mfg technikadonis
vielen Dank für die Antwort, nachdem ich das Makor endlich gestartet hatte, funktionieren die Rocker-Switchs.
Jetzt stehe ich aber anscheinend noch auf der Leitung, wie ich mit diesen Switchs "Signale" aus einem Sym-File beeinflusse, sodass der Zustand der Switchs auf dem CAN übertragen wird.
Muss ich hierfür in der "Do While"-Schleife statt "PrintToOutputWindow" einen Befehl zum Absetzen einer CAN-Nachricht ausführen?
mfg technikadonis
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Radio-Buttons
Sie verändern doch schon Signale innerhalb des Macros. Wenn sich der Status eines Schalters ändert, wird doch das *.Value eines echten Signals verändert. Diese Signale sind in der SYM Datei definiert. Wenn Sie weitere Signale verändern wollen, dann machen Sie das auf die gleiche Weise.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------