01-12-2010 12:19 PM
Manufacture provides an ActiveX control to use in LabVIEW. One function "OpenConnection (ServerName: PChar; out Result: OleVariant) requires a Pascal PChar type; when accessed from LabVIEW, it is converted to String type. I tried to wire a normal LabVIEW string, it returned an error saying the ActiveX Server is not installed or registered. I manually registered the server, but it still returns the same error.
01-12-2010 12:57 PM
01-12-2010 01:14 PM
Actually, there is no error message from LabVIEW. The error I referred to is the message from manufacture program.
The attached LabVIEW code runs fine until the last step which is trying to close the connection that never established. The automation open is working well without error.
01-13-2010 02:46 PM
Do the activeX calls return the correct data? It only gives an error at close connection?
01-13-2010 03:24 PM
The first call to "OpenConnection" returns '-2' (no LabVIEW error), which means 'the ActiveX server' is not installed or registered. Then at closing, it returns a LabVIEW error saying "Catastrophic Failure", which I think is because the connection was never established in the first place.
So I still think it is the LabVIEW string is not compatible with the Pascal string, when I feed the name of the ActiveX server, although it looks to the right name, it is converted to a different pascal string. Then the program cannot find the proper server.
I don't think anything can be done from LabVIEW to fix it in this case.
01-19-2010 09:08 AM
Here we go. Problem solved, not by NI, but by the Pascal programmer. I think here is a good lesson for those manufacture programmers who provide driver set. Don't use variable type like Pascal string, because it is different from string type in other language including LabVIEW. Use Variant type instead, it makes everything easier.
I don't know if this makes any sense to other people, but that is how it solved our problem.