LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue when programming a Diolan DLN-2

Greetings Ni community,
 
   I am trying to program a Diolan DLN-2 that works with a magnetometer, simliar to what I've done with a USB-8451. However, I receive an error coe of 1172 - "Error calling method Dln.I2cMaster.Port.Write, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
    Inner Exception: Dln.Exceptions.DlnError: DLN adapter returns error: InvalidAddress.) <append><b>Dln.Exceptions.DlnError</b> in i2c-master-configure.vi"

 

 

 

  Attached is the zip file. It contains the DLL, the file I am trying to code with the Diolan (i2c-master-configure.vi), the data sheet for the magnetometer I am working with, and the other VI that I wrote to work with the magnetometer via the NI USB-8451 (Working Magnetometer.vi).

 

    Apologies if my code is not right on the Diolan - again I'm trying to program it similar to the one I have working for the 8451,

 

  I am by no means an expert at LabVIEW, but I am getting better day by day.

 

   My code is in 2012. Let me know if you need a previous version.

 

  Thanks!

   TheLT

0 Kudos
Message 1 of 7
(3,112 Views)

Hi there, check this article. It explains that error 1172 is basically a warning coming from the .NET operation performed. I would suggest to check the manual of the device in case you are not invoking references appropriately. There are some VIs missing so I can't see all the code but I assume that somewhere on the "i2c-master-configure.vi" there is a Constructor Node. Since you are new to LabVIEW I would recommend to look at the examples on the DLN-2 manual and then try to reproduce them in LabVIEW. If you get a little lost, open the examples that uses the Constructor node in order to make yourself more familiar with it. I hope this helps.

Alejandro C. | National Instruments
0 Kudos
Message 2 of 7
(3,097 Views)

Alejandro,

 

  Thanks for the post. Yes there are some constructor nodes in the "i2c-master-configure.vi" I will read the article as well as I thought the error code was through Diolan, not NI.

 

  If you do need the other VIs let me know and I can zip them. But I will reach out again to the manufacturer since there's obviously more of a problem with their setup, as they actually provided my with the LabVIEW VIs. I only added 2 constructor nodes. Even without those that I added, I still get the 1172 error.

 

  Thanks for the article, and I will keep you posted. I'll leave this board open for now.

 

  Thanks!

   TheLT

0 Kudos
Message 3 of 7
(3,089 Views)

Alejandro - so I did check that article and the DLL is in the .NET Assemblies is memory. Is there any other reason why I am receiving this error? Could their DLL be corrupt or something?

 

Thanks!
TheLT

0 Kudos
Message 4 of 7
(3,088 Views)

Well...even if I had the code, I don't have the hardware to test it appropriately. Since you mentioned that both VIs and DLL are coming from the manufacturer ask them if they have tested it on your LabVIEW version and OS, perhaps you are dealing with a compatibility issue.

 

Sure, it's a good idea to double check the DLL however; I believe the problem is the way some of the functions are being called. Looking at the error description, I'm expecting a failure coming from one invoke node after calling the DLL. I would track the root of the error, once you know where is coming from, try different setups based on the programmer manual. Taking small steps and test the code before moving forward.

Alejandro C. | National Instruments
0 Kudos
Message 5 of 7
(3,078 Views)

Alejandro,

 

  Thanks - I'll give that a shot and keep you posted.

 

  Thanks!

   TheLT

0 Kudos
Message 6 of 7
(3,075 Views)

To update, there was a problem with the DLL. I am running tests currently and will update accordingly.

0 Kudos
Message 7 of 7
(3,038 Views)