Sent directly via email since the newsgroup won't allow an attachment.
Francisco Resquin wrote: > Dear Gordon, > > I have some problem with xPC Target RS232 communication, and I can not > find the white paper (xPC Target Serial Communication Information) that > you mentioned before. Please, can you send me the zip files? > > Best regards. > > Gordon Weast <firstname.lastname@example.org> wrote in message > <email@example.com>... >> What you're trying to do is quite possible. Please take a look at the >> paper with examples at: >> http://www.mathworks.com/products/xpctarget/technicalliterature.html >> >> Download the zip file under 'xPC Target Serial Communication >> Information' (second item under 'Fact Sheets'). Read it and see if >> your questions are answered. >> >> Gordon Weast >> xPC Target Development >> MathWorks >> >> Zhuo Li wrote: >> > "RED STONE" wrote in message <firstname.lastname@example.org>... >> >> I am designing a moment control system which is used on train. The >> >> core element to be controled is an EC motor. I have designed a simple >> >> control board based on FPGA which can translate control command to the >> >> motor and translate the angle speed informantion to the center control >> >> PC by RS-232 port. >> >> Now the center control PC is the Target PC whose control law is >> >> designed in a laptop. >> >> Both the control command and the angle speed data are translated in >> >> hex format. Today I did many experiments to identify the RS232 >> >> communication and found some intresting things. >> >> The format of data from the motor to Target PC is FF FF FF xx xx xx >> >> cc. >> >> FF FF FF: has no meaning >> >> xx xx xx: the angle speed >> >> cc: the command >> >> The format of data from Target PC to the motor is cc. >> >> cc: the command >> >> First,the problem in my last mail was sloved, just setting the >> >> format as %c and Matlab can translate the integer into hex format. The >> >> motor can follow the command after setting it as %C. I have try other >> >> option such as %x, %f... but have no effect. >> >> Second, because the data from the motor to Target PC has 7 bytes. >> >> So I setted the Mainboard RS-232 receive block format as '%x %x %x %x >> >> %x %x %x' , update the model, the receive block generate 7 port. And I >> >> add xpcscope for each to observe the data as the appendix with the >> >> letter.In the experiment I found that if I changed the sample time the >> >> turn of the receive data can be chaned the same time. For example, you >> >> may receive the data as 'FF FF xx xx xx cc FF 'or'' FF xx xx xx cc FF >> >> FF 'and so on. Can you give me some advices? thanks!!! >> >> RED STONE >> > >> > >> > Hi, Did you finanly get an answer? I have the same problem. >> > Actually, I hope Matlab can design the FIFO block to be able to read the >> > hardware buffer only when there is new message coming in instead of >> > keeping sampling it. I also tried to include "read to delimiter", but >> > still, it auto wraps the words. Regards, >> > Li