MATRIXx

cancel
Showing results for 
Search instead for 
Did you mean: 

Printing in 2000/XP, version 7.01

Hello,

I am using version MATRIXx version 7.01 on both the Windows 2000 and on the Windows XP platform. Could somebody tell me how to print to any of the system printers?"

Thanks in advance

Hugo Grimmelius
0 Kudos
Message 1 of 7
(8,725 Views)
Hugo,
This depends on what you want to print.

You can print a plot window by going to File>Print. The dialog will let you choose the printer that you will be using. If you set up the environment variable XMATH_PRINT then you can execute the command hardcopy from Xmath to get a printout of the plot.

In SystemBuild then select the model that you want to print and then go to File>Print.

If you want to print output that is in the Xmath window, then create a CommandDiary or SessionDiary. Then you can print the diary using Oscmd("print ...."). Open a command prompt and type help print for more information on print.

Carl L
National Instruments
0 Kudos
Message 2 of 7
(8,724 Views)
Carl,

My problem is that I want to print out about 2000 graphs, preferably to PDF using the Acrobat Distiller, using the hardcopy command in a (rather complex) script file.

There are several problems when I try to do this:
1) I don't know what to put in the XMATH_PRINT variable so it will use the Acrobat Distiller (or any other Windows printer not connected to FILE: or LPT1: for that matter).
2) Using hardcopy directly to file using the file= structure works, but only for about 60 times, then xmath 'hangs'. Repeating the process in batches is possible, but the script has to be restarted. There is a tendency for an 'assertion error' to show up after several of those batches, but neglecting it does seem to work fine. (The script runs fine through all 20
0o plots if I disable the hardcopy command and just view the graphs on screen.)
3) The proces hardlnx.exe is not terminated and stays active after each hardcopy. So in the end there are several hundred hardlnx.exe processes activated, each using about 3 Mb of memory, but not using any CPU. (This seems to be a minor problem: I use machines with 512 Mb or more internal memeory and have not experienced any difficulty in that area, it is just a nuisance. Also, having several hundred hardlnx.exe processes running does not influence the behaviour of MATRIXx as decribed above.)

Maybe there is a way to avoid these problems, and I would be anxious to hear about it. I am at the moment trying to finish my PhD thesis (which already started in 1993, using MATRIXx 2.0 I believe) and this was a most unwelcome and unexpected problem...

Kind regards,

Hugo Grimmelius
0 Kudos
Message 3 of 7
(8,724 Views)
Hugo,
I don't have any experience with Acrobat Distiller, but I'll work with the assumption that it is the same as any other printer. The easiest way is to share the printer. You only have to give yourself access. Go to Start>Settings>Printers. Then right-click on the printer and choose Share. Then click on Share As and give it a name. You will now be able to access the printer as \\computername\sharename. Set XMATH_PRINT=path-to-xmprint \\computername\sharename

Hardlnx only remains in memory until it is done executing. However when hardcopy is called several times in a script then hardlnx does not get any execution time until the script is done. This is why you see several copies of hardlnx in memory. They way around it would be to break
it up into several batches. What is the assertion that you get?

Carl L
National Instruments
0 Kudos
Message 4 of 7
(8,724 Views)
Carl,

Thanks, the trick with the shared printer works fine, except for the Distiller, where an 'access denied' is returned. The Distiller problem is solved by letting the Distiller watch the directory were the postscript files are created, it then automatically transfers them to PDF. Bit of a work around, but it works and also allows me to define my own filenames (with 2000 plots that becomes a very important issue).

The assertion errors are:

Assertion failed: file "m:\remain\xm\interpreter\job.cxx", in line 81 errno 0

Alternated with:

Assertion failed: file "m:\remain\xm\interpreter\job.cxx", in line 81 errno 109

or

Assertion failed: file "m:\remain\xm\interpreter\job.cxx", in line 81 errno 126

For the record: I do no
t have a m-drive connected to my system.

Thanks for your support!

Kind regards,

Hugo Grimmelius
0 Kudos
Message 5 of 7
(8,724 Views)
Hugo,
The assertion is saying that a job with the same ID is in progress. I have been trying to reproduce the error here. Does it happen when you print to file, or only when you send it directly to the printer?

One possibility is to print in the foreground. By default the hardcopy prints in the background, but you can use the fg keyword and then the script will wait for the hardcopy command to come back. This would definately resolve the issue of having multiple copies of hardlnx present in memory at the same time. You would be able to print all 2000 plots from the same script. It may also avoid the assertions.
Example:
hardcopy file="c:\testfile", {fg}

Carl L
National Instruments
0 Kudos
Message 6 of 7
(8,724 Views)
Carl,
The assertion error happened when printing to file, I do not print directly to a printer anyway. And all problems disappeared with the addition of those two small letterd 'fg'! I've been using it extensively and it now works marvelous, even with Acrobat Distiller running the conversion to pdf in parallel.

Thanks very much!!

Kind regards

Hugo
0 Kudos
Message 7 of 7
(8,725 Views)