Quantcast
Viewing all 203588 articles
Browse latest View live

Re: fatal internal error 0x0037C03D: "MemoryManager.cpp", line 1318 with Array Handle Pointer dll

Hi Rolf,

thanks for the tips!

 

I tried following your suggestions but I still cannot get it work.

This is where the combination of your help and some stackoverflow.com led me:


from ctypes import * path = '..\\array.dll' lib = CDLL(path) elmtCount = c_int32(10) dimSize = 0 # need to initialize otherwise I get --> NameError: name 'dimSize' is not defined # update structure definition def updateStructure(self, field_name, field_type): fields_copy = self._fields_ found = False for idx, itm in enumerate(fields_copy): # find matching field name i = list(itm) print(i[0]) if i[0] == field_name: i[1] = field_type fields_copy[idx] = tuple(i) # update with the new type found = True break if not found: print('element not found') # return False class TmpStructure(Structure): _pack_ = self._pack_ _fields_ = self._fields_ return TmpStructure class DoubleArrayBase(Structure): _fields_ = [ ('dimSize', c_uint32), ('NumericControl', (c_double * dimSize)) ] def __init__(self, dimSize): self.dimSize = dimSize self.NumericControl = (c_double * dimSize)() # dll methods getArray = lib.getArray #solution A # array_out = byref(byref(updateStructure(DoubleArrayBase, 'NumericControl', (c_double * 10)))) #solution B array_out = pointer(pointer(DoubleArrayBase(10))) # get array getArray(byref(array_out)) print(array_out.NumericControl[1])

Solution A turns the ctype structure in a not valid 'ctypes.PyCStructType'

 

Solution B manages to update the NumericControl, but I still get the fatal error message.

 

At this point I was wondering if there should be any call to the *.h methods:

/* * Memory Allocation/Resize/Deallocation APIs for type 'DoubleArray' */ DoubleArray __cdecl AllocateDoubleArray (int32 elmtCount); MgErr __cdecl ResizeDoubleArray (DoubleArray *hdlPtr, int32 elmtCount); MgErr __cdecl DeAllocateDoubleArray (DoubleArray *hdlPtr);

 

I tried using them following as much as possible what you suggested in your C code, but nothing's new.

 

Thanks anyway for the support!

 

Dimitris


DLL compilation depending on LabVIEW version

Hello dear Community,

Best wishes for the new year!

I've a question regarding on the dll compilation. I've developp an application with LabVIEW, which call an external dll to do Something particular. I've used this method to be able to update the function into the dll without generate new application: I've just to stop my application, replace dll and restart application. The dll is generated with LabVIEW too. This application is used on some computers of my society, with run-time engine installation.

It's properly run, but I've a version problem: I can only use a dll compiled with the LabVIEW version corresponding to the higher version of LabVIEW Runtime installed of my computer. For example:

- dll compiled and application build with LV15; LVRTE10 and LVRTE15 installed: OK

- dll compiled and application build with LV15; LVRTE10, LVRTE15 and LVRTE18 installed: NOK

- dll compiled and application build with LV18; LVRTE10, LVRTE15 and LVRTE18 installed: OK

Is it a possibility to compile a dll which can used on a computer which have same or higher LVTRE version? it will be fine if my dll compiled with LV15 could be called on a computer which have LVRTE15, 18 and 19... (like an exe compiled with LV15).

Thank you per advance!

Impossible to adresse a CPU cores uper than 32 with timed loop

Hi !

I come back after my previous post on this subject who has been closed (by my self) too quickly apparently.

I am working on a 4 sockets computer with 4 intel xeon CPU 18 cores, 36 threads each. So 144 threads in total.

I tri to get the most out of this machine but i can't run any programme on more than 32 threads.

I learned about CPU group that Windows creat but in my case it creat group of 36 cores, so i should be eable to acces at least this 36 cores.

In this small exemple I can adress cores from 0 to 31 but if i select core 32 or more it's the core 0 who run.

Image may be NSFW.
Clik here to view.
Capture1.PNG

Image may be NSFW.
Clik here to view.
Capture2.PNG

Image may be NSFW.
Clik here to view.
Capture3.PNG

Does any one, who have a computer with more than 32 cores, can try to run the same code to see if the result is the same.

Any one have an idea ?

Re: Impossible to adresse a CPU cores uper than 32 with timed loop

You should provide a link to that other thread.

 

And technically, you can't "Close" a post.  You may have marked a post in the thread as the solution, but it doesn't close it.  You or anyone else can still post messages in there as necessary.

Re: Impossible to adresse a CPU cores uper than 32 with timed loop

Re: Wait on Front Panel Activity crashes labview?

Any particular reason you are inverting the output of the tick count?

NI-VISA Driver Wizard sous Windows 10

Re: DLL compilation depending on LabVIEW version

I don't have experience with Building DLLs with LabVIEW, but I have heard people like to use packed project libraries (.lvlibp) to handle your situation. You can update just the lvlibp to change functionality without modifying the code that calls it.

 

Just a question on your LabVIEW versions, are they all the same bitness? (32-bit or 64-bit?)


Re: DLL compilation depending on LabVIEW version

I don't know the answer to the question you're asking, but kinda wonder whether you should be asking it.

 

If I was distibuting an app to multiple PC's, I would make an installer that included the necessary RTE for the LV version I was developing in.   And then whenever I compiled a dll to be used by that app, I would create the dll in the same LV version I used to create the executable.

 

So what's different about your overall approach to things, and why?

 

 

-Kevin P

Re: LabVIEW interface with agilent B2901A source meter

Hi,

I have downloaded and run the VI, but it cannot initialize Keysight B2901A.  Please let me know why?

Re: LabVIEW interface with agilent B2901A source meter

We need more details!  Which VI did you run, what errors did the VI produce, what errors were displayed on the instrument.

 

How are you physically connected to B2901a?  What steps have you taken to verify your connection is working?  

 

To get good answers, provide good details.

Craig

Re: hex display to number


 wrote:

Sorry about my post if that upset you. After I gave him a kudo, I thought I would like to say  "thank you" to him as well. 


(It would take significantly more to upset me. :D)

That was actually just a gentle reminder that "thanks", which are very nice in real life, don't really work well on a forum.. 😉

 

OTOH, you actually did many things right, for example searching the forum and finding an answer instead of creating a new post. 😄

Re: I want to save the Acquired data from agilent

Does it ask you for a filename as your program is finishing running? Have you probed the data to see if there is anything there?

Re: Wait on Front Panel Activity crashes labview?


 wrote:

Any particular reason you are inverting the output of the tick count?


It's just a subtraction and the comparison acts as a poor man's detector if the wait has timed out or not.

Would be nicer if the function had a "timed out?" output, though. 😉

Re: VIAS USB data format

The according schematic shows that the SDP-S board is basically using the FTDI2232HQ chip. So it would be possible to access this interface through the FTD2XX DLL but you will have to then figure out how to configure the I2C or SPI interface to communicate with the desired serial bus interface of your chip.

I would not attempt to redevelop the FTDI driver on top of NI-VISA, as much as that might be an interesting project in terms of geek factor. Also the I2C and SPI interfaces aren't quite controllable through the Virtual Communication Port interface that the FTDI also supports when you install their VCP driver instead of the FTD2XX driver, but is meant for the use of the RS-232, 422 and 485 operation modes of those chips.


TCP - Multiple Connections Causing Lock-Ups - 2018

Scenario:

I've got a board with two micros, each programmed to act as a server.  Each with a separate IP Address (and different Port just to for kicks and giggles).  Both on the same subnet.  This has been confirmed repeatedly.  My LabVIEW 2018 program is designed to communicate to both.  I have 3 loops running.  One loop runs the event structure.  The other two run the the connect/read/write TCP connections to the respective micro.  I use two functional globals to store and handle the respective references.  So they're separate VIs, however, I do not fully understand if a call to a TCP connect and what not act like typical VIs where they can only be opened once and if anything else wants to use it must wait until it's done.  Even if this is the case, I shouldn't be getting the issues I'm getting I'd think.

 

Problem: 

A TCP connection is successfully made to one of the micros and continues on with expected behavior.  But the second loop is still trying to make connection.  Eventually, the second loop makes the connection and I instantly lose connection in the first loop.  But then... EVERYTHING FREEZES!  Event structure comes to a complete stop.  I have it set to timeout at 100ms since I need to calculations.  The timeout also sends a data request to the TCP connections via a queue system (there's logic behind it).  If I shutdown one of the loops from the get-go, the single TCP connection has no issue and there's no freeze up.  I've also been able to switch between the two for this exercise.  So I've technically proven my code that the master/slave queue system is working and I request data and receive it.  But not when both are running (and yes, I'm using two different queues).

 

I know there's a lot of info and I'm sure someone is wanting VIs.  I would ask first if I'm not using the TCP VIs correctly yet before anyone asks to debug.  Do I need to make a single TCP Handling VI that switches between the two references?  Or is it just not possible to make two connections?

Re: I want to save the Acquired data from agilent

I have been using teh HP/Agilent/Keysite 3497xA units for years and I am surprised your code works at all...

 

What you have here is a giant race condition

Image may be NSFW.
Clik here to view.
raceCapture.PNG

Your program is going to try to send all of these commands at the same time. Or if the VI's are not re-entrant the sub-vi's will run i a random order. basically BAD PROGRAMMING!!!

 

Here's one of my examples of how to properly configure and use this device

 

Re: Wait on Front Panel Activity crashes labview?

As you can plainly see, I suck at bit-wise operations.

Re: TCP - Multiple Connections Causing Lock-Ups - 2018

No, you do not need to make a single VI to process both connections. You are doing something wrong in your code. I have applications that have well over 100 next connections open and functional at the same time. I wonder why you are functional globals for your references. A better solution would be to have your VI handle the open/do stuff/close and keep track of its TCP reference.

Re: How do I turn off Auto Grow for all structures in memory?


 wrote:

Sorry for the thread resurrect, but, the one valid case I can think of is if you are inheriting a huge mess to refactor, at least in my case, the top level VI is so large (read: no flow, no structure, no modules) that moving things around and cleaning up is super slow, and moving over structure boundaries is super slow because it starts trying to resize etc. 


I've inherited code where the developer loved to cram as much code into nested structures with the borders of the inner structure touching the border of the outside one.  One little move of a node and all of a sudden the block diagram explodes as the structure walls run away from each other.  THAT's when I hate auto-grow.  😉

Viewing all 203588 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>