From: Edmund on 24 Mar 2010 12:54 Hi, Is there a way to send the world "hello" in simulink from a serial send block? I am asking since it can only send binary data, so how can I use simulink to send a word such as 'hello' rather than a number to an external device connected via USB? thanks Edmund
From: Shankar on 24 Mar 2010 17:10 Hi Edmund, The Serial Send block sends only binary data. You can use the Query Instrument block to send a command to the device/instrument that you have connected and receive data. I would like to know what you are trying to achieve before suggesting a solution. If you could explain more on your application, that will be helpful. Thanks Shankar "Edmund " <azuro20025(a)hotmail.com> wrote in message <hodg3d$db7$1(a)fred.mathworks.com>... > Hi, > > Is there a way to send the world "hello" in simulink from a serial send block? I am asking since it can only send binary data, so how can I use simulink to send a word such as 'hello' rather than a number to an external device connected via USB? > > thanks > Edmund
From: Edmund on 24 Mar 2010 17:38 "Shankar " <ssubramaREMOVETHIS(a)mathworks.com> wrote in message <hodv3s$pie$1(a)fred.mathworks.com>... > Hi Edmund, > > The Serial Send block sends only binary data. You can use the Query Instrument block to send a command to the device/instrument that you have connected and receive data. > > I would like to know what you are trying to achieve before suggesting a solution. If you could explain more on your application, that will be helpful. > > Thanks > Shankar > > "Edmund " <azuro20025(a)hotmail.com> wrote in message <hodg3d$db7$1(a)fred.mathworks.com>... > > Hi, > > > > Is there a way to send the world "hello" in simulink from a serial send block? I am asking since it can only send binary data, so how can I use simulink to send a word such as 'hello' rather than a number to an external device connected via USB? > > > > thanks > > Edmund Hi Shankar, Thanks for the response. This is my system, I am using Simulink to get an image from camera, get the position of a ball via pixels, then convert these pixels into height in cm and according to this height ht1 I am getting the servo angles as shown below: function u= fcn(ht1) s_angle=((11.06)*(ht1-5))+1918; x=ceil(s_angle); u=uint16(['']); % where #0Px must be. variable x will have a value between 2250 - 1918. I am controlling the servo motor via servo controller SSC 32 in which requires input such as #0P1500 to turn the servo motor. When I was using Matlab I used the following commands to turn the servo motor: s_angle=((11.06)*(ht1-5))+1918 x=ceil(s_angle) temporary=sprintf('#0P%d',x) fprintf(S,temporary) % where S is port deceleration Now since Simulink does not allow characters to pass through one block to another how may I send the data of the character values #0P1500 in which the servo controller will recognize. If I do uint('#0P1500') for example I get an output of u = 35 48 80 49 53 48 48 these values can not be recognized by the servo controller as servo angles since #0 represents the servo channel and P1500 is the position of the servo. I hope I explained myself in a way that you may understand :). Thanks again Edmund
|
Pages: 1 Prev: Installation problem Next: How to create a matlab gui which includes a moving object |