Arduino TCP/IP Send with vector of uint8
1 view (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Sreeram Mohan
on 7 Jan 2015
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
0 Comments
See Also
Categories
Find more on Modeling in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!