![]() |
|
|||||||
| CQC Support Report bugs, make wishes, discuss plans, ask questions |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Well, I have given up on trying to get my Epson projector driver to work with PDL. I am dropping down to CML.
I didn't make it too far. I typed up my driver, and tried to compile. I am getting a CQCDriverBase not found error on my ParentClass line. Did I miss a piece during the install or something? I thought I installed all components.... Class= ... ParentClass MEng.System.CQC.Runtime.CQCDriverBase; EndClass; |
|
#2
|
||||
|
||||
|
Make sure you are using the driver IDE, not the Macro Workshop.
__________________
Dean Roddey Software Geek Extraordinaire |
|
#3
|
|||
|
|||
|
Thanks Dean. Maybe you should add a stupid questions forum so I have a place to put these.
![]() Next problem, I can't construct string literals. Is there a way to do this or should I just create a variable: //---- Connect String --- "ESC/VP.net[DLE][ETX][NULL][NULL][NULL][NULL]" String kCmd_Connect("ESC/VP.net" & 0x10 & 0x03 & 0x00 & 0x00 & 0x00 & x00 ); It fails after the last quote, expecting a ")". |
|
#4
|
||||
|
||||
|
What are you trying to create there? If I understand what you are trying to do, that's wouldn't create a legal string even if CML supoprted that kind syntax, since it has nulls in it. If you want to send something like that, you'll have to do it as binary data. So use a memory buffer object and put the data into that.
So you'd use a MemBuf object, and do something like: CurLen := m_MyBuf.ImportString("ESC/VP.net"); m_MyBuf.PutCard1At(4, CurLen++); m_MyBuf.PutCard1At(3, CurLen++); m_MyBuf.PUtCard1At(0, CurLen++); and so on. I probably didn't get the numeric code for DLE correct, but you get the picture. Once you have the bytes in the buffer, then just write the buffer out, using CurLen as the length; The ImportString() is a cheap way to transcode text into the buffer using ASCII code points, so it'll save you the trouble of putting the chars in one at a time, or using a loop to do it.
__________________
Dean Roddey Software Geek Extraordinaire |
|
#5
|
|||
|
|||
|
Thanks. Your parms were in the wrong order above, but I got it all working. Now I have a successful compile.
Now on to the hard stuff... The Epson requires the connect string above and sends the following response: ESC/VP.net[DLE][ETX][NULL][NULL][SP][NULL] I coded the following to retrieve the message and it appears to work: If (!(GetTermedMsg2(m_Sock, EndTime, 0x20, 0x00, True, ToFillBuff) > 0)) .... EndIf; m_XCoder.ConvertFrom(ToFillBuff, 10 ,ToFill); ToFillBuff will end up with everything but the final [SP][NULL], which I think is right. I then move on to an initial command to get the power status. I send a message but the response is preceded by a [NULL] that is still left in the socket buffer from the connect, throwing off my replies. I get a response of (in a GetTermedAscii2): [NULL]PWSTATUS=xx xxxxxx I have a sniffer trace and know the [NULL] didn't come in from the projector. I suspect it is left over from the GetTermedMsg2. How can I clear this NULL out of the socket buffer? Last edited by wuench : 09-03-2006 at 09:47 AM. |
|
#6
|
||||
|
||||
|
You can't use the termed msg for this, because null in the second term byte tells it that there is no second term byte. So it's not reading that last null. Or, if you do use it, if it returns true, then do a ReadByte immediately afterwards to get rid of the null left in the buffer.
BTW, if you know this content is ASCII, it would be cheaper to use the ImportString and ExportString methods of the memory buffer to do the transcoding and get rid of the m_XCoder.
__________________
Dean Roddey Software Geek Extraordinaire |
|
#7
|
|||
|
|||
|
I just realized that too.
I added a second GetTermedMsg2 to pull out that last null. I can't think of a better way to do it. The only message that has these nulls is on the initial connect, the rest is simple ascii. This is the main reason I had to do this in CML. I'll look into the import/export methods. Thanks again. |
|
#8
|
|||
|
|||
|
Sorry didn't read your reply completely.
Where is ReadByte located? I can't find it documented anywhere. As a side note, can we get the Macro Classes put into a PDF someday? It would be nice to have something searchable. It's hard to pick through on the website. |
|
#9
|
||||
|
||||
|
ReadByte is a method of the socket class.
__________________
Dean Roddey Software Geek Extraordinaire |
|
#10
|
|||
|
|||
|
What is the syntax for ReadByte?
It is not in the Macro Class info on the website. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|