In SX Microcontrollers, SX/B Compiler and SX-Key Tool, natpie wrote: [quote="Castrovinci"] still having trouble with that. I have this and i am geting invalid number of parameters What am I suppose to declare with this tmpB1 VAR word ' subroutine work vars tmpB2 VAR Byte tmpB3 VAR Byte tmpB4 VAR Byte 'tagBuf VAR Byte(10) tmpW1 VAR Word anthony var byte myvarible var byte FOR myvarible = 0 to 4 serin ra.3, n9600, tmpB1 anthony(myvarible) = tmpB1 Next tx_str anthony I shortened this, but what am I missing? You declared tmpB1 as a word. That is two bytes. Change tmpB1 to a byte and that error should go away. You also atempted to cram a word into a byte on the anthony(myvariable)=tmpB1. You didn't declare anthony as an aray. The for loop isn't the most eligant answer to this I just offered that as an example of how to populate a sudo string. Honestly i realy don't like the serin and serout commands. If you program is sitting around waiting for serial input they are okay, but if you want your micro controler to do something else like check a sensor it can miss a serial command. You also can't recive a byte while you are transmiting a byte. Of course I also cant ressist an interupt in my code and that rules them out. One of the examples posted in the best of sx forms has an interupt driven virtual UART with a 16 byte buffer( i think its 16). It is writen in such a way as you can plug it into your program without realy knowing why it works. IT has the nessary subs and funcs to get items out of the buffer and push them into the transmit buffer. Using this solution you only have to check when it is convenent if it has rescived any bytes, if not you can get back to what you were doing, if you did you can stop and see what you want to do with it. Please remember this is only my two cents. Some may completly disagree with my opinion, you may be one of them. Play with the differnt options. If a solution works for you it may be the correct way to go. There are many solutions, and as it apears you are trying to master serin and serout this may not be the time for you to experiement with Interupt based serial comunication. I just wanted to point out the other way and its advantages.[/quote] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=372213#m372309 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)