- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Using Modelica Device Drivers Library
Page Start Prev 1 Next End
Using Modelica Device Drivers Library
Using Modelica Device Drivers Library
Jan-20-17 06:26:28
Hello,
I am trying to use Modelica Device Drivers Library to send some serial data through COM port and receive the data at the other end using a null modem. The model compiles and runs but, no data is sent over the serial port. Below is the code that I used.
Code:
model serialTest
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Packager packager1(enableExternalTrigger = false, useBackwardPropagatedBufferSize = false, useBackwardSampleTimePropagation = true);
Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddFloat addFloat1(byteOrder = Modelica_DeviceDrivers.Utilities.Types.ByteOrder.LE,n = 1, nu = 1);
Modelica.Blocks.Sources.RealExpression realExpression1(y = 35.68 * 21.25);
Modelica_DeviceDrivers.Blocks.Communication.SerialPortSend serialPortSend1(Serial_Port = "COM3", autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B9600, enableExternalTrigger = false, parity = 0, sampleTime = 0.1, startTime = 0, userBufferSize = 16 * 64);
Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1;
equation
connect(serialPortSend1.pkgIn, addFloat1.pkgOut[1]);
connect(realExpression1.y, addFloat1.u[1]);
connect(addFloat1.pkgIn, packager1.pkgOut);
annotation(
uses(Modelica_DeviceDrivers(version = "1.4.4"), Modelica(version = "3.2.2")));
end serialTest;
I am using Windows 7 x64 OS with OpenModelica v1.11.0-dev.beta1-10-g789afa4 (64-bit).
For serial port, I am using an FTDI device, which is recognized by the OS as COM3.
Please let me know what went wrong and how to make the data transfer. Thanks in advance!!
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Using Modelica Device Drivers Library
There are 0 guests and 0 other users also viewing this topic