caio ribeiro Posted September 15, 2016 Report Share Posted September 15, 2016 Hi, I 'm new to samba and Visulogic programming, and I'm having some problems to use the samba sm35-j-t20 serial port to send data into a chinese printer(csn-a2-r), it uses rs232... I initialize the the com with the printer parameters and I configured an protocol, but when I try to send the messages something goes wrong, The data is not sed correctly, it appears ramdom stuff in the printer. obs.: the printer is 12vdc so I hacked it with a lm7812 to be able to use it with the same power supply. Someone have done something similar and/or can help please? here is the link for the printer and i'm attaching the code for the samba. https://cdn-shop.adafruit.com/datasheets/CSN-A2+User+Manual.pdf giga de testes com impressora.vlp Link to comment Share on other sites More sharing options...
HigHTech Posted September 20, 2016 Report Share Posted September 20, 2016 On 15/9/2016 at 2:45 PM, caio ribeiro said: Hi, I 'm new to samba and Visulogic programming, and I'm having some problems to use the samba sm35-j-t20 serial port to send data into a chinese printer(csn-a2-r), it uses rs232... I initialize the the com with the printer parameters and I configured an protocol, but when I try to send the messages something goes wrong, The data is not sed correctly, it appears ramdom stuff in the printer. obs.: the printer is 12vdc so I hacked it with a lm7812 to be able to use it with the same power supply. Someone have done something similar and/or can help please? here is the link for the printer and i'm attaching the code for the samba. https://cdn-shop.adafruit.com/datasheets/CSN-A2+User+Manual.pdf giga de testes com impressora.vlp First try to establish communication with a comm simulator like hercules, so you can check if the protocol you are using is right. I made one application to write barcodes on Zebra. The key factor was first checking the protocol with hercules then when you know the message is ok, then send using the PLC. Good luck Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted September 21, 2016 MVP 2023 Report Share Posted September 21, 2016 I agree with all that HiTech says, especially on Hercules...a great little program. Link: http://www.hw-group.com/products/hercules/index_en.html I suggest you play with it first to get to know it's fundamentals. That manual for the printer is quite good, so concentrate on getting simple instructions received ok, like an LF and Full cut, then progress from there. I have also had serial instances where inversion of lines 2 & 3 are needed despite manufacturer information describing normality/showing nothing about this. Once it was squirrelled away in troubleshooting...no mention at all in the main connections advice section. Dumb! If all else fails, give it a try. A breakout box makes this easy and is a great tool to have in the kit. cheers, and again, good luck. Serial is sometimes a pain! Aus 1 Link to comment Share on other sites More sharing options...
caio ribeiro Posted October 6, 2016 Author Report Share Posted October 6, 2016 On 21/09/2016 at 8:15 PM, Ausman said: I agree with all that HiTech says, especially on Hercules...a great little program. Link: http://www.hw-group.com/products/hercules/index_en.html I suggest you play with it first to get to know it's fundamentals. That manual for the printer is quite good, so concentrate on getting simple instructions received ok, like an LF and Full cut, then progress from there. I have also had serial instances where inversion of lines 2 & 3 are needed despite manufacturer information describing normality/showing nothing about this. Once it was squirrelled away in troubleshooting...no mention at all in the main connections advice section. Dumb! If all else fails, give it a try. A breakout box makes this easy and is a great tool to have in the kit. cheers, and again, good luck. Serial is sometimes a pain! Aus it worked like a charm, the real problem was the printer power supply, the printers are 12v and my power supply was 24v, so i used a lm7812 to supply it, but the power consuption was higher than what the ci could feed, so i used two instead and worked! thanks for the help guys! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now