You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 5th, 2019, 01:58 AM   #1
ahmadk
Member
Qatar

ahmadk is offline
 
ahmadk's Avatar
 
Join Date: Jan 2019
Location: Qatar
Posts: 16
9040 markem imaje Printer

Hello everybody
I'm try to find a way to get response from a 9040 Markem Imaje Printer after send an a massege like ACK 06h or NAK 21h anyone can help me ? plz ,
i will appreciate that
  Reply With Quote
Old February 5th, 2019, 11:07 AM   #2
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Cobourg
Posts: 2,789
http://www.opctalk.com/board/PubBoar...eManual-en.pdf

The printer will only respond to commands sent to it with the ACK or NACK.
What command are you sending to the printer? Are you calculating the Checksum correctly?

Here is sample code to get the checksum.
Sub CheckSum()
'Calculating Checksum For Transmission
L = Len(SendBuffer)
A = 0
For J = 1 To L Step 2
TJ$ = Chr$("&H" & (Mid$(SendBuffer, J, 2)))
A = Asc(TJ$) Xor A
Next J
FCS$ = Hex$(A)
If Len(FCS$) = 1 Then FCS$ = "0" + FCS$
SendBuffer = SendBuffer + FCS$
End Sub


Hope this helps you out.
Regards,
__________________
Garry
https://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old February 6th, 2019, 01:20 AM   #3
ahmadk
Member
Qatar

ahmadk is offline
 
ahmadk's Avatar
 
Join Date: Jan 2019
Location: Qatar
Posts: 16
thanks for your time ( Gclshortt)
i will try to calculate the checksum correctly , but now i need an example of command to send a complete massage for the printer
thank you for your time again
  Reply With Quote
Old February 6th, 2019, 08:20 AM   #4
gclshortt
Member
Canada

gclshortt is offline
 
gclshortt's Avatar
 
Join Date: Dec 2014
Location: Cobourg
Posts: 2,789
Note:
Sending a message to the printer is complicated to get it correct. An easier way is to create the message on the printer and then upload the message. Once you have the message uploaded, you can easily see all of the parts that make up the message. Then use the message download instruction.

Regards,
__________________
Garry
https://www.accautomation.ca
Connect with us on Facebook: facebook.com/accautomation/
  Reply With Quote
Old February 7th, 2019, 04:07 AM   #5
ahmadk
Member
Qatar

ahmadk is offline
 
ahmadk's Avatar
 
Join Date: Jan 2019
Location: Qatar
Posts: 16
Now iam try to send some request command like autodating
my question is whate the command syntax and type to get response
like "D6<LF>00<LF>D6" how i can send LF correctly
Regards.
  Reply With Quote
Old February 10th, 2019, 08:11 AM   #6
ahmadk
Member
Qatar

ahmadk is offline
 
ahmadk's Avatar
 
Join Date: Jan 2019
Location: Qatar
Posts: 16
Quote:
Originally Posted by gclshortt View Post
Note:
Sending a message to the printer is complicated to get it correct. An easier way is to create the message on the printer and then upload the message. Once you have the message uploaded, you can easily see all of the parts that make up the message. Then use the message download instruction.

Regards,
now i can send command like d6\n00\nd6 and i get some response
but now i face some problem when calculate checksum value is always wrong
i need an example of command with there checksum value to understands how calculate it .
regards
  Reply With Quote
Old February 10th, 2019, 11:59 PM   #7
Geoff White
Member
Australia

Geoff White is offline
 
Join Date: Oct 2005
Location: Brisbane
Posts: 330
What are you trying to calculate the checksum on?
The example above is doing to the checksum for a string of 2 digit hex values.

I don't believe that the printer is accepting ascii-hex data. You should be sending a pure ascii string.

To do the checksum on that you just xor the ascii value of each character in the message and stick it on the end as another character. So if the XOR ends up as 65 then you will be putting an "A" at the end of the string.
  Reply With Quote
Old February 11th, 2019, 12:56 AM   #8
ahmadk
Member
Qatar

ahmadk is offline
 
ahmadk's Avatar
 
Join Date: Jan 2019
Location: Qatar
Posts: 16
Quote:
Originally Posted by Geoff White View Post
What are you trying to calculate the checksum on?
The example above is doing to the checksum for a string of 2 digit hex values.

I don't believe that the printer is accepting ascii-hex data. You should be sending a pure ascii string.

To do the checksum on that you just xor the ascii value of each character in the message and stick it on the end as another character. So if the XOR ends up as 65 then you will be putting an "A" at the end of the string.
in the printer manual i was read that ,
the printer accept hexadecimal in command format and return response from each command,
the problem now is how i can calculate the check sum for a specific command
for example i need to read the current message from the printer ,so based on manual i need to send request like " 43 01 01 'xx' " now what i should replace 'xx' (checksum byte)
Sorry for taking long.
  Reply With Quote
Old February 11th, 2019, 02:27 AM   #9
Geoff White
Member
Australia

Geoff White is offline
 
Join Date: Oct 2005
Location: Brisbane
Posts: 330
43h = 0100 0011
01h = 0000 0001
XOR = 0100 0010
01h = 0000 0001
XOR = 0100 0011 = 42h

43 01 01 42 = C^A^AB

See https://www.rapidtables.com/convert/...-to-ascii.html
  Reply With Quote
Old February 11th, 2019, 03:04 AM   #10
ahmadk
Member
Qatar

ahmadk is offline
 
ahmadk's Avatar
 
Join Date: Jan 2019
Location: Qatar
Posts: 16
Quote:
Originally Posted by Geoff White View Post
43h = 0100 0011
01h = 0000 0001
XOR = 0100 0010
01h = 0000 0001
XOR = 0100 0011 = 42h

43 01 01 42 = C^A^AB

See https://www.rapidtables.com/convert/...-to-ascii.html
Thx for your response and your time
i was calculate it in same way and get same result
then i was sent to printer but the printer didn't return any response
so i need to determine whate is wrong my command or the checksum
regards
  Reply With Quote
Old February 11th, 2019, 03:53 PM   #11
Geoff White
Member
Australia

Geoff White is offline
 
Join Date: Oct 2005
Location: Brisbane
Posts: 330
Oops that checksum is 43h.
  Reply With Quote
Old February 11th, 2019, 04:27 PM   #12
Geoff White
Member
Australia

Geoff White is offline
 
Join Date: Oct 2005
Location: Brisbane
Posts: 330
All the examples in the manual are shown in Hex for readability but the stream is not sent as asciii hex. They don't seem to say it anywhere but the protocol describes the command and checksum as a byte.

You may also need to configure the printer to accept the protocol.

Get a good troubleshooting program like Hercules SETUP tool that can send/receive data via serial/TCP/UDP as a server or client

Good luck
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
9040 markem imaje Printer ahmadk LIVE PLC Questions And Answers 1 January 29th, 2019 02:30 AM
1734-232ASC Comms to Printer Crammed77 LIVE PLC Questions And Answers 8 July 19th, 2016 06:46 PM
SLC100 print to USB printer configuration for printing ladders Alex-F LIVE PLC Questions And Answers 4 November 13th, 2015 02:31 PM
Mitsubishi PLC Q series to Sato printer using Rs232 sttchui LIVE PLC Questions And Answers 0 September 6th, 2015 02:48 AM
How to connect Domino A200 inkjet printer to PC TKADA LIVE PLC Questions And Answers 3 November 10th, 2014 04:38 AM


All times are GMT -5. The time now is 06:02 AM.


.