Did you send us an email? We have not received one yet.
There are two ways to do this, either with a standard macro or with a vbs-macro.
It is important to know, that there is a default multiplexer that does act as a container for variables. This Multiplexer has the name "Empty".
Also make sure the symbol file is loaded in the connection you want to use.
Standard Macro
Here an example from the PCAN-Explorer 5 Help-File:
Syntax
Send Bus Symbol Multiplexer DataBytes
Code: Select all
// Symbol2 has no Multiplexer
Send 1 Symbol2 <Empty> AAh BBh
<Empty>
is the default-multiplexer.
If your Symbol-File does not have any multiplexer you still have to refer <Empty>
VBS Macro
To make this easier to understand please take a look at the PCAN-Explorer 5 help and take a look at the diagram you can find in:
Automating Tasks in PCAN-Explorer -> PCAN-Explorer Objects -> Diagram of the Object Model
Let's take this Symbol-File as an starting point:
Code: Select all
FormatVersion=5.0 // Do not edit this line!
Title = "DefaultMultiplexerSymbol"
{SENDRECEIVE}
[MySymbol]
ID=000h
DLC=1
Var=Var1 unsigned 0,1
Var=Var2 unsigned 0,1
Now our vbs-example looks like this:
Code: Select all
Sub SendSymbolExample()
Dim sym, msg
Set sym = SymbolsManager("DefaultMultiplexerSymbol").Item("MySymbol")
Set msg = sym.DefaultMultiplexer.Send(1, peSendWait)
msg.VariableValue("Var1") = 123
msg.VariableValue("Var2") = 4.56
msg.Write 0
End Sub
Set sym = SymbolsManager("DefaultMultiplexerSymbol")
This is the Title-Property of your Symbol-File,
.Item("MySymbol")
This is the name of your symbol,
Set msg = sym.DefaultMultiplexer.Send(1, peSendWait)
you can refer to the default multiplexer like shown above,
msg.VariableValue("Var1") = 123
msg.VariableValue("Var2") = 4.56
here you refer to your variables contained within your symbol file.
Best Regards
Marvin