Charmed Quark Systems
Google
WWW CharmedQuark.com

Go Back   Charmed Quark Systems > General Discussion > CQC Support
Register FAQ Members List Calendar Mark Forums Read

CQC Support Report bugs, make wishes, discuss plans, ask questions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-31-2006, 09:58 AM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,550
Default Epson Cinema 500 Driver Development CML

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;
Reply With Quote
  #2  
Old 08-31-2006, 10:26 AM
Dean Roddey's Avatar
Dean Roddey Dean Roddey is online now
Administrator
 
Join Date: Aug 2002
Location: Mountain View, CA
Posts: 32,478
Default

Make sure you are using the driver IDE, not the Macro Workshop.
__________________
Dean Roddey
Software Geek Extraordinaire
Reply With Quote
  #3  
Old 08-31-2006, 03:48 PM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,550
Default

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 ")".
Reply With Quote
  #4  
Old 08-31-2006, 03:57 PM
Dean Roddey's Avatar
Dean Roddey Dean Roddey is online now
Administrator
 
Join Date: Aug 2002
Location: Mountain View, CA
Posts: 32,478
Default

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
Reply With Quote
  #5  
Old 09-03-2006, 09:43 AM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,550
Default

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.
Reply With Quote
  #6  
Old 09-03-2006, 09:54 AM
Dean Roddey's Avatar
Dean Roddey Dean Roddey is online now
Administrator
 
Join Date: Aug 2002
Location: Mountain View, CA
Posts: 32,478
Default

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
Reply With Quote
  #7  
Old 09-03-2006, 10:00 AM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,550
Default

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.
Reply With Quote
  #8  
Old 09-03-2006, 10:38 AM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,550
Default

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.
Reply With Quote
  #9  
Old 09-03-2006, 12:07 PM
Dean Roddey's Avatar
Dean Roddey Dean Roddey is online now
Administrator
 
Join Date: Aug 2002
Location: Mountain View, CA
Posts: 32,478
Default

ReadByte is a method of the socket class.
__________________
Dean Roddey
Software Geek Extraordinaire
Reply With Quote
  #10  
Old 09-03-2006, 02:05 PM
wuench wuench is offline
 
Join Date: Jan 2006
Location: Saint Louis, MO US
Posts: 2,550
Default

What is the syntax for ReadByte?

It is not in the Macro Class info on the website.
Reply With Quote
Reply


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

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


All times are GMT -8. The time now is 04:54 PM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.