KNOWLEDGEBASE - ARTICLE #913

How can Prism be integrated with other programs? How can I create a program that saves Prism files?

Does Prism have a scripting language? Yes, it is fully described in the Prism  help starting here,

Can a Prism script control how Prism analyses and graphs data?
No. A Prism script can open a Prism project file (or template), import data, and export results and graphs. But the details of how data are analyzed and graphed are stored in the Prism file. Note that when you change data, Prism updates the results and the graphs. This includes updating analysis constants and paste-linked data. For this reason, Prism scripts tend to be very short and easy to write.

Does Prism have an API that can be called from other programs?
No. But other programs can launch a Prism script. Read the details about how this works with the Windows and Mac versions of Prism.

Can other programs create Prism files?
Yes.

Some background to understand the steps below. In the PZFX file format, all the data and info tables are in plain text XML that other programs can edit or replace.

Follow these steps:

  1. Create a Prism file, with data, analyses and graphs as you want them.
  2. Save from Prism in the PZFX format.
  3. Then open the file with a text editor (notepad). The analysis and graphing stuff are all encrypted in a way you can't access. But the data and info are in plain text, structured, XML.
  4. Edit the data (and perhaps the info constants), and resave.
  5. Double click on the file to open in Prism. You'll see that graphs and analyses are updated to analyze and graph the new data.

Using this approach, you can effectively (from the user's point of view) save a Prism file from your application (or instrument). No scripts. No need to use your software and Prism on the same computer at the same time. No need to even use the same platform (Win vs. Mac) for Prism and your program. All you have to do is replace the data portion of a .PZFX file, and resave it.

You can also combine the PZFX approach with scripting. You can save a script within the file, and it appears in plain text (so could be edited). Make one obvious edit in the XML and that script is automatically run when the file is opened (or closed). For example, you could have a script that automatically prints all graphs whenever the file is opened.

Note also that the Info constants are in plain text in the .PZFX file. Info constants can be used simply to document lot numbers, notebook page numbers, or any structured experimental detail. They can also be "hooked" to analyses to be used as constants. If you change the info constant in the .PZFX file, the hooked analyses and graphs will be updated when you open the file. 

Can other programs create XML data files for importing into Prism?

Yes. Try exporting a Prism data table in XML format, then view the file with a text or XML viewer. If you view in a browser, the built-in style sheet will be used to display the data tables in a structured way. When you export in XML format, the exported file includes all special formatting, including Greek characters, subscript, superscript, subcolumn formats, etc. When you later import an XML file, everything should just work. There is no ambiguity about whether commas are for decimals, thousands, or used to separate columns. There is no ambiguity about columns and subcolumns, about column titles vs. the first row of data, etc. But the XML file has just the data, so importing it will just import data sheets, with no analyses or graphs. If you want your file to include data, analyses and graphs, use the PZFX format.

How to view the XML style sheet and schema

Here are the Prism XML style sheet and schema. These show every detail of how Prism encodes XML If you know the syntax for these kinds of files, You'll also find these file in the Prism application folder (Windows) or bundle (Mac).

Note one confusing point. There are two tags to begin a table:  <HugeTable> and <Table>, with the same attributes. <Table> is used for Prism tables that have less or equal to 04 data sets and less or equal to 52 subcolumns. <HugeTable> is used for tables with more than 104 data sets and/or 52 subcolumns. This distinction is helpful for downward compatibility. Prism 5 ignores HugeTable. 

Which instruments can save Prism files?

Help us create this list. 

Image Analyst MKII



Keywords: integrate, instrument, API

Explore the Knowledgebase

Analyze, graph and present your scientific work easily with GraphPad Prism. No coding required.