Arduino TCP/IP Send with vector of uint8

6 次查看(过去 30 天)
I'm attempting to use the Support Package for Arduino Hardware to make an Ethernet shield equipped Arduino Due send data from multiple sensors over TCP/IP to a Simulink model running on the PC. I can run the example "arduinodue_tcpsend" which takes the output of a "Counter Limited" block with endpoints [0 255] and routes that to the input of the Arduino "TCP/IP Send" block.
Extending this example by using a "Mux" block to combine the outputs of two "Counter Limited" blocks and send the vector signal to the "TCP/IP Send" block produces the following error:
Error in port widths or dimensions. Output port 1 of 'arduinodue_tcpsend/TCP//IP Send/Data Type Conversion' is a one dimensional vector with 2 elements.
Error in port widths or dimensions. Input port 1 of 'arduinodue_tcpsend/TCP//IP Send/TCP Send' is a one dimensional vector with 1 elements.
Is there a simple workaround here? I noticed that the help documentation for the "Arduino Serial Transmit" block explicitly states that it "accepts vector or scalar uint8 data", but the documentation for the "Arduino TCP/IP Send" block says "accepts uint8 values". For my application, however, TCP/IP is highly preferable.

回答(1 个)

Sreeram Mohan
Sreeram Mohan 2015-1-7
Hi John,
One workaround you could try though is you could use multiple TCP IP send blocks in the model with different port numbers and receive them on the host model and may be then combine them on the host using a mux or what ever and interpret the data as needed.
By default looks like upto 4 distinct ports are supported ! Hope this helps
Thanks,
Sreeram Mohan

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by