06-20-2007 10:58 AM
Dim
CMotionInterface As ISMICMotion
Set
CMotionInterface = CommInterface
Visual
C++:
ISMICMotionPtr CMotionInterface;
HRESULT
hr=CommInterface.QueryInterface(__uuidof(ISMICMotion),&CMotionInterface);
if
(FAILED(hr))
{
AfxMessageBox("The interface
\"ISMICMotion\" not found!");
return;
}
06-21-2007 05:14 PM - edited 06-21-2007 05:14 PM
Message Edited by Yi Y on 06-21-2007 06:02 PM
11-14-2008 10:24 AM
Hi Louis,
I just started to work with the Smart Motors and using the dll to drive them.
Did you solve this problem?
If so, please give a hint how you did it
regards,
Martin
11-17-2008 04:46 PM
Hi MartinE,
Have you been able to find the references that Yi Y talked about? I agree that this seems to be the key to the problem. Hopefully Louis or someone else who has done this will chime in and be able to give some insight.
11-18-2008 06:43 AM
Hi Adam H,
As far as I found in the documentation there is no reference from the Com interface to the Motion interface.
I posted this problem also to my distributor of the SmartMotors, he passed the question through to Animatics.
I sent them my test vi to show the problem.
regards,
Martin.
11-18-2008 10:01 AM
Hi Adam,
The issue I had was with initializing the ISMICMotion interface which is used for Contouring Mode, also called Coordinated Motion. I've attached a VI with two initialization examples. The first in green is the typical init I use to control motors with individual Motor RefNums. If you are not trying to do Coordinated Motion with the CMotion interface then you would use this init. The second in orange is the init routine I used to start Coordinated Motion. The key there is the Variant to Data VI. I don't remember exactly how it works in this case because it was a while back when I figured this out, but I remember finding relevant information in the Developer Zone on using the Variant to Data VI with Automation or ActiveX.
I hope this helps.
best regards,
Louis
11-19-2008 02:58 AM
Hi Louis,
Great that you responded after this time and even better, found a solution for the problem as far as I can see just doing initialization.
I modified your example a little to get it working, but the essential thing was the use of the variant to data vi.
many thanks,
Martin.