Running multiple macros one by one
Running multiple macros one by one
Hi,
Is it possible in any way to start with a button a run of multiple macros one by one with a delay in VBscript?
I have a panel which is running macros using buttons(with ExecuteCommand),I run 3 separate macros , one standard macro and two VB macros, I was wondering if I can run all of them with the same button.
thanks a lot
k-tod.
Is it possible in any way to start with a button a run of multiple macros one by one with a delay in VBscript?
I have a panel which is running macros using buttons(with ExecuteCommand),I run 3 separate macros , one standard macro and two VB macros, I was wondering if I can run all of them with the same button.
thanks a lot
k-tod.
Re: Running multiple macros one by one
Hello,
in PCAN-Explorer you can only run one macro at a time. It will not be possible to start several macros with the same button, or start another macro from inside a macro.
best regards
Michael
in PCAN-Explorer you can only run one macro at a time. It will not be possible to start several macros with the same button, or start another macro from inside a macro.
best regards
Michael
Re: Running multiple macros one by one
Hello,thank you for your quick reply
In this case is it possible to do this with a script? I just need to send 2 periodic mesages(order doesn't matter and 6 other messages in a specified order), at the moment i use 3 buttons to execute 2 vb macros for the periodic messages and 1 standard macro for the other 6, and I need to execute them with a single button, could you please help?
thank's
In this case is it possible to do this with a script? I just need to send 2 periodic mesages(order doesn't matter and 6 other messages in a specified order), at the moment i use 3 buttons to execute 2 vb macros for the periodic messages and 1 standard macro for the other 6, and I need to execute them with a single button, could you please help?
thank's
Re: Running multiple macros one by one
Hello,
the simplest solution will be to put all together in just one macro
regards
Michael
the simplest solution will be to put all together in just one macro
regards
Michael
Re: Running multiple macros one by one
Hi, I succeded to put toghether the 2 VB macros but don't know how to transmit a non periodic message with VB macro,could you please help me to send msg2 as non periodic, I am really a beginner and maybe it's easy but I could not find how to do it so far.
thank you,
k-tod.
thank you,
k-tod.
Code: Select all
Sub My_sub_01()
Dim msg
Set msg = TransmitMessages.Add
msg.ID = &H100
msg.DLC = 3
msg.MsgType = pcanMsgTypeStandard
msg.Data(0) = &H20
msg.Data(1) = &H3A
msg.Data(2) = &H00
msg.SendPeriod = 4000
msg.IsPaused = False
Wait 5000
Dim msg1
Set msg1 = TransmitMessages.Add
msg1.ID = &H100
msg1.DLC = 3
msg1.MsgType = pcanMsgTypeStandard
msg1.Data(0) = &H3A
msg1.Data(1) = &H03
msg1.Data(2) = &H7F
msg1.SendPeriod = 100
msg1.IsPaused = False
Wait 500
Dim msg2
Set msg2 = TransmitMessages.Add
msg2.ID = &H100
msg2.DLC = 3
msg2.MsgType = pcanMsgTypeStandard
msg2.Data(0) = &H20
msg2.Data(1) = &H00
msg2.Data(2) = &H03
msg2.SendPeriod = 1000
msg2.IsPaused = False
Wait 500
End Sub
Re: Running multiple macros one by one
Hi,
here an example on how to transmit non periodic messages:
Dim msg3
Set msg3 = TransmitMessages.Add
msg3.ID = &H300
msg3.DLC = 3
msg3.MsgType = pcanMsgTypeStandard
msg3.Data(0) = &H11
msg3.Data(1) = &H22
msg3.Data(2) = &H33
msg3.Write 0
msg3.ID = &H400
msg3.DLC = 2
msg3.Data(0) = &H44
msg3.Data(1) = &H55
msg3.Write 0
here an example on how to transmit non periodic messages:
Dim msg3
Set msg3 = TransmitMessages.Add
msg3.ID = &H300
msg3.DLC = 3
msg3.MsgType = pcanMsgTypeStandard
msg3.Data(0) = &H11
msg3.Data(1) = &H22
msg3.Data(2) = &H33
msg3.Write 0
msg3.ID = &H400
msg3.DLC = 2
msg3.Data(0) = &H44
msg3.Data(1) = &H55
msg3.Write 0
Re: Running multiple macros one by one
Thank you a lot,
now it's working
now it's working
Re: Running multiple macros one by one
as far as i know, you can only use one macros at a time. in my own conception, issues might possibly occur if you use multiple macros.k-tod wrote:Hi,
Is it possible in any way to start with a button a run of multiple macros one by one with a delay in VBscript?
I have a panel which is running macros using buttons(with ExecuteCommand),I run 3 separate macros , one standard macro and two VB macros, I was wondering if I can run all of them with the same button.
phen375 review
thanks a lot
k-tod.
Last edited by Edwou1971 on Wed 2. Nov 2016, 23:24, edited 1 time in total.
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Running multiple macros one by one
Only one VBS could run in one instance of a PCAN-Explorer. If you use a main loop and call the SUB in a loop, you could also create larger and more complex scripts. But it is a VBS - if you want to build complex GUI, use the available HighLevel API based on PCAN-Basic.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------