From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Discussions au sujet des autres produits NI

annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

Question Related to LIN API use with MFC Visual C++ 6.0

Hi
 
I am using the LIN API library nicanmsc.lib and Nican.h file to work with the MFC application that I am writing in Visual C++ 6.0.
 
The problem i am encounter with one the API of Nican.h  called  "ncWrite(NCTYPE_OBJH          ObjHandle,
                           NCTYPE_UINT32        SizeofData,
                           NCTYPE_ANY_P         Data)"
 
As this API is used to configure the LIN Interface Slave task to configure or subscribe the data.To do that you have to have frame type is response Entry frame and  one of Data Type called "Is Remote " value equal to 16. Now I am doing exactly same things to achieve configure response entry frame to send data from slave based on the ID from master. As I am able to run this API from my application and its executing correctly and sending correct information that I want to send to Master but the problem I am seeing is that when you execute any of this API it comes with STATUS  back of the execution part went correctly on not based on the value that it returns. In my case eventhough the command looks to me executed correctly as sending the correct data but the STATUS comes with negative value which means it has something wrong in it. I can't figure out the problem in here.
 
Let me know if you any body encounter this kind of problem before. I described you the best way i can describe the problem but if any body has more question feel free to ask it.
 
Thanks
 
Chirayu
0 Compliments
Message 1 sur 6
3 148 Visites
Hello,
could please tell to us the error code returned by the NI-CAN API ?
It would be helpfull.
Best Regards,
Pierre R...

Certified LabVIEW Developer
0 Compliments
Message 2 sur 6
3 140 Visites

Well,

It returns no error code but Whenever you call this API it returns the STATUS information back, which basically tell us based on the value that the API executed correctly or not. If STATUS value is 0 than it is good .If value is negative than it has some error in execution function didn't perform the expected behaviour. Positive means warning that means function perform expected behaviour but condition arose requires some attention. In my case i am getting the negative status back for this particular API eventhough looks to me it performs correctly.

Let me know if you have any more questions.

Thanks

Chirayu

0 Compliments
Message 3 sur 6
3 130 Visites
So , for sure, I totally agree with you.
But really, it would be very helpfull if you would be able to give us one of the error code returned by te API...
Sorry to seem repetitive... but it's needed..
Pierre R...

Certified LabVIEW Developer
0 Compliments
Message 4 sur 6
3 126 Visites
OK attached is the Error code and Message that it will print if we print the status information in String form.Its .jpeg  file.let me know if you have any trouble to open the file.
 
Thanks
 
Chirayu
0 Compliments
Message 5 sur 6
3 122 Visites
Hi,
 
There must be something wrong with your frame type. Is the frame type (IsRemote) really dezimal 16. Perhaps you configured it in hex 16 and then it translates to d22?
Could you perhaps enable Error Logging to receive an Error frame with detailed error information?
 
DirkW
0 Compliments
Message 6 sur 6
3 097 Visites