01-31-2007 07:46 AM
Can you try the attached version of the package if it works on your mac. I don't have a mac so I cannot test it. I removed the .exe and it seems to work still on my PC.
Can it be made platform independent? When I try to open it on my Mac it asks for LabVIEW.exe.
01-31-2007 08:04 AM
01-31-2007 09:18 AM - edited 01-31-2007 09:18 AM
> From: Jim Kring
> Sent: Thursday, December 18, 2003 12:37 AM
> To: opengtoolkit-developers
> Subject: RE: 'Occurrence' OpenGOOP Object
>
> Rolf,
>
> I was able to get AllocOccur, Occur, and DeallocOccur. They seem to work great. I also noticed the following functions exported by LabVIEW.exe (LV70), which look interesting.
>
> AllocOccurHdlr
> OccurAtTime
> OnOccurrence
> OnOccurrenceWithTimeout
> InterruptSafeOccur
>
> I would presume that 'OnOccurrenceWithTimeout' is analagous to the 'Wait on Occurrence' primitive... is this right?
>
> -Jim
>
>
> > -----Original Message-----
> > From: Rolf Kalbermatter
> > Sent: Thursday, December 18, 2003 12:21 AM
> > To: opengtoolkit-developers
> > Subject: RE: 'Occurrence' OpenGOOP Object
> >
> >
> > Jean-Pierre,
> >
> > You are right, but use "LabVIEW" instead. "LabVIEW.exe" will
> > only work on Windows as LabVIEW will just do a LoadLibrary on
> > that name and it does not have an exe extension on all
> > platforms. But the "LabVIEW" keyword is apparently trapped in
> > the CLN function and directly redirected to its own export
> > function table without using the platform specifc LoadLibrary call.
> >
> > You can see that when using "LabVIEW" you don't get any
> > functions listed in the Function name drop box as LabVIEW
> > does aparently not support enumerating directly the export
> > table but you can get all the names if you enter exactly the
> > path the to LabVIEW.exe file, as LabVIEW then just enumerates
> > the export section of the executable image, which is exactly
> > the same for Win32 DLLs as it is for Win32 EXEs.
> >
> > So you first enter the full path to LabVIEW.exe, then select
> > the appropriate function and then change the path to
> > "LabVIEW". Now you just need to know the exact prototypes 😉
> >
> > /* This is the same as the NotARefnum constant in LabVIEW */
> > #define kNonOccurrence 0
> >
> > /* Basically the same as a LVRefNum, an opaque pointer to a
> > LabVIEW private data structure, which you should never try to
> > assume anything about as it may completely change between
> > versions. I think current LabVIEW actually uses here a so
> > called cookie which is a 32 bit number only meaningful to the
> > instance who created it. */ Private(Occurrence);
> >
> > Occurrence AllocOccur(void);
> > MgErr Occur(Occurrence occ);
> > MgErr DeallocOccur(Occurrence o);
> >
> > Rolf Kalbermatter
> >
> > > -----Original Message-----
> > > From: Jean-Pierre Drolet
> > > Sent: Wed, December 17, 2003 2:21 PM
> > > To: opengtoolkit-developers
> > > Subject: Re: 'Occurrence' OpenGOOP Object
> > >
> > >
> > > Jim,
> > >
> > > I think that by using CLNs within labview.exe to functions
> > > like AllocOccur and DeallocOccur you can create (new at
> > each call) and
> > > destroy occurences. However, I don't know how platform
> > > (in)dependant it is. I'm sure Rolf has more to say about this...
> > >
> > > Jean-Pierre
> > >
> > >
> > > ----- Message d'origine -----
> > > De : "Jim Kring"
> > > À : "'OpenGToolkit-Developers'"
> > > Envoyé : 16 décembre, 2003 23:06
> > > Objet : 'Occurrence' OpenGOOP Object
> > >
> > >
> > > Hello All,
> > >
> > > One thing that I have found bothersome about occurrences is
> > that the
> > > 'Generate Occurrence' function is more of an Occurrence "constant"
> > > than a "generator". Each call to an instance of 'Generate
> > > Occurrence' will return
> > > the same occurrence. So, I wrapped the occurrence primitives
> > > in a stripped
> > > down OpenGOOP Class. The data store contains only an
> > > occurrence, and there
> > > is one unique occurrence per object instance (since the
> > data core is a
> > > reentrant LV2 global, called by reference). Another added
> > > benefit of having
> > > OpenGOOP wrapper VIs around the occurrence primitives is that
> > > they have
> > > error IO, which makes data flow sequencing possible without
> > > the classic
> > > one-frame sequence structure.
> > >
> > > So, I have a few questions:
> > >
> > > Does it make sense to augment the default behavior of
> > > occurrences? If so,
> > > what features and behaviors should be implemented? Is this
> > > tool useful?
> > >
> > > Regards,
> > >
> > > -Jim
Message Edited by Jim Kring on 01-31-2007 07:21 AM
01-31-2007 09:40 AM
You must be getting old, you are commenting to someone called Jimi...
@Jim Kring wrote:
Jimi: Thanks for updating the code -- I figured that there were still some loose ends. Also, it can be made platform independent by changing the library link from "LabVIEW.exe" to just "LabVIEW" (I forgot to do that before posting).
02-01-2007 08:03 AM
Jim,
Your reply warrents 50 stars!
Is there any wonder why I list JPD and Rolf as a two of my mentors. After reading that message I turned to my wife and said,
"When I grow-up, I want be able to understand everything that Rolf says."
This prompts me to throw out the Q for anyone that thinks they are up to this mini-challenge.
Jim has taken the information from Rolf and used that to develop his code.
Can anyone "connect the dots" between Rolf's words and Jim's code?
Again, thank you Jim!
Ben
02-01-2007 09:40 AM
@Ben wrote:
Can anyone "connect the dots" between Rolf's words and Jim's code?
> > /* Basically the same as a LVRefNum, an opaque pointer to a
> > LabVIEW private data structure, which you should never try to
> > assume anything about as it may completely change between
> > versions. I think current LabVIEW actually uses here a so
> > called cookie which is a 32 bit number only meaningful to the
> > instance who created it. */ Private(Occurrence);
> >
> > Occurrence AllocOccur(void);
> > MgErr Occur(Occurrence occ);
> > MgErr DeallocOccur(Occurrence o);
Basically, Rolf said that there are C functions which are exported from the LabVIEW executable which you can call to do these things. You can see the list of these function (on Windows) by dropping a CLF node and pointing it to the LabVIEW.exe file, but you must provide the full path. Some of the function names are fairly clear (like AllocOccur), so all you need to know is which parameters they recieve and what they return and that's what Rolf supplied.
The AllocOccur function recieves a void (i.e. nothing) and returns an occurence, which is basically an I32 value. Since you need to use it as an occurence, Jim type cast it into an occurence.
The same goes for the other two functions mentioned here (although I don't know what Occur does. Maybe it returns an error if the occurence passed to it is invalid?).
What I am really wondering about is whether or not these OpenG functions will work in an executable, as they rely on a function found inside the LabVIEW executable. Perhaps the RTE holds these as well somewhere.
02-01-2007 10:25 AM
What I am really wondering about is whether or not these OpenG functions will work in an executable, as they rely on a function found inside the LabVIEW executable. Perhaps the RTE holds these as well somewhere.
02-01-2007 10:39 AM
02-01-2007 11:23 AM - edited 02-01-2007 11:23 AM
Message Edited by Jim Kring on 02-01-2007 09:24 AM
02-01-2007 11:43 AM