SRBox Port Number configured at runtime?

David McFarlane mcfarla9 at msu.edu
Thu Jan 27 22:15:20 UTC 2011


Doug,

OK, thanks for fleshing out the details.  As long as the COM port 
remains stable on each machine, and you know what it is for each 
machine, then the clumsy but simple way to work around this is just 
to make a custom E-Run (.ebs2) file for each possible COM 
port.  I.e., on your development station, open your .es2 file, and 
generate a .ebs2 with COM set to 1 (label it something like 
"MyExpt(COM1).ebs2)"; then set COM to port 2 and generate another 
.ebs2 file (e.g., "MyExpt(COM2).ebs2)"), etc.  Once you have a 
collection of .ebs2 files for any COM port, just copy the appropriate 
file to each machine, and voila, all should run.

But say you want a single .ebs "image" that you can run on each 
machine, using an external "config" file to customize it for each 
machine.  Since you have EP2, you can take advantage of the new 
StartupInfo File feature, and in fact this very situation is covered 
in section 1.6.2.6 of the New Features Guide (but PST staff should 
have told you this already).  (If you used EP1 instead of EP2, the 
the documentation for the StartupInfo File points the way to another 
workaround:  you could store the COM address in an external text 
file; then, with some inline code, read it using Input# statements, 
and then, using the SRBox initializaton code already generated in the 
InitDevices subroutine as a guide, construct your own inline code to 
initialize the appropriate COM port.)

I was a bit afraid that your COM port could change arbitrarily from 
session to session on a single machine, and that you wanted E-Prime 
to dynamically configure itself on each session.  That *would* have 
been a tall order!


(BTW I regularly advise *against* using a "runtime" installation, as 
I have explained at 
http://support.pstnet.com/forum/Topic3736-4-1.aspx , 
http://groups.google.com/group/e-prime/browse_thread/thread/1ab4456e77da1eaf 
, and 
http://groups.google.com/group/e-prime/browse_thread/thread/caa60dee31e74f35 .)

-- David McFarlane, Professional Faultfinder


At 1/26/2011 03:10 PM Wednesday, you wrote:
>Thanks for your response, David. On one machine, the COM port number
>won't change once I plug in the USB SRBox and it gets assigned a port
>number. HOWEVER, from machine to machine, the COM ports assigned may
>be different. That is a problem for us. We would like to be able to
>develop and generate one script file and distribute it around to
>different machines that have only the runtime version of E-Prime on
>them (no developer components). Currently, when our application is
>"compiled" the COM port number basically gets hard-coded into the
>code, so we would have to generate 4 different versions of the code
>for all possible COM port assignments. This seems a bit ridiculous.
>
>To answer a few of your other questions: We are using E-Prime 2.0. And
>someone from the IT department installs the runtime components of E-
>Prime on our machines as an Administrator, but afterward we are only
>ever running as a User (not an admin).
>
>Thanks again,
>- Doug
>
>On Jan 25, 11:26 am, David McFarlane <mcfar... at msu.edu> wrote:
> > Doug,
> >
> > Stock reminder:  1) I do not work for PST.  2) PST's trained staff
> > takes any and all questions 
> athttp://support.pstnet.com/e%2Dprime/support/login.asp, and they
> > strive to respond to all requests in 24-48 hours -- this is pretty
> > much their substitute for proper documentation, so make full use of
> > it.  3) If you do get an answer from PST Web Support, please extend
> > the courtesy of posting their reply back here for the sake of others.
> >
> > That said, here is my take...
> >
> > What version of E-Prime do you use?  More importantly, what do you
> > mean by "when we plug the device into a computer, it will be assigned
> > whatever COM port is available"?  Do you really mean that any single
> > computer has dynamically assigned COM ports that can change whenever
> > you plug a device into it?  I have never heard of such a thing, so I
> > would like to know more.  Typically COM port addresses remain static
> > in any one machine, so once you know what it is on that machine you
> > can plug the SRBox into the COM port and it will not change, and you
> > can edit the .es or .es2 file for that machine to refer to the
> > appropriate COM port (just make sure that the COM port lies in 
> the range 1-4).
> >
> > There are ways to do something like what you ask in both EP1 and EP2,
> > but I don't yet understand why your situation requires this.
> >
> > BTW, if you do not have admin access to these PCs, then how do you
> > get EP installed on them in the first place?
> >
> > -- David McFarlane, Professional Faultfinder
> >
> > At 1/23/2011 09:30 AM Sunday, you wrote:
> >
> > >We are using an SRBox and it seems we have to configure the COM port
> > >number at design time. This doesn't work for us since when we plug the
> > >device into a computer, it will be assigned whatever COM port is
> > >available. We won't have administrative access on these machines, so
> > >we won't be able to reassign the COM port with Device Manager. Even if
> > >we could, it is possible that another device is currently using that
> > >COM port number. So basically, we need the ability to specify the COM
> > >port number of the SRBox to e-Prime at runtime. Is there a way to do
> > >this with an external config file or something?
> >
> > >Thanks in advance for any suggestions,
> > >Doug

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list