Page 1 of 1

How to send symboles

Posted: Thu 8. Feb 2024, 12:15
by scope
I don't really understand the documentationm can you help me send a symbole using a VBS Macro File

Re: How to send symboles

Posted: Thu 8. Feb 2024, 16:44
by PEAK-Support
VBS samples are part of the online documentation. But we could send you a sample package for better understanding.
Please send a E-Mail to support[at]peak-system.com

The main important Information is to understand that a Signal could be "bind" to a VBS Variable, and so you could set and get the Signal value very easy.

Code: Select all

  ' Name of the used Symbol file we want to use (we could have many in one project)
  Set symbol = SymbolsManager("Power")
  
  ' We use the predefined CAN Signals from the Symbol File we select
  Set voltage = Signals("Voltage")
  Set current = Signals("Current")
In the Symbol File "Power" is a signal defined called "Voltage" and one called "Current"
In VBS, you could after this code access directly to the Values of the Signal

Reading

Code: Select all

Power = Voltage.Value * Current.Value 
or Writing

Code: Select all

Voltage.Value = 220
then the CAN-ID (Symbol) that stores the Signal Voltage will be automatically send to the CAN-Bus.
This is a very simple sample, but explain in basic how it works.

Re: How to send symboles

Posted: Thu 8. Feb 2024, 17:11
by scope
Thank you, I sent an email