-
Posts
1,172 -
Joined
-
Last visited
-
Days Won
106
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by Neil Pate
-
Hi Rolf, Any update on this? I have a project coming up which requires a scripted test sequence, and was thinking this could be a good opportunity to try this. Do you have a idea on pricing? Neil
-
I remember seeing something around about 2010 about this. If memory serves me correctly forum member jgcode did some digging into this and had a usable example, but there were some things preventing a complete solution. I also think there is a NI community page dedicated to this, but cannot find it either. Sorry!
-
System directory hidden from LabVIEW (Not really a LabVIEW problem)
Neil Pate replied to Neil Pate's topic in LabVIEW General
Thanks for the info dhakkan and LogMAN. I was able to copy my files to SysWOW64 and LabVIEW-32 bit was able to read them, even though in the code there are hardcoded paths of c:\Windows\System32. -
Happy new year everybody Now, onto this year's first conundrum. I am trying to get some customer code running on my PC, and am getting a bit unstuck with some strangeness that I cannot explain. In particular this application reads and writes to files in a directory, lets call it ABCD that lives in c:\Windows\System32\ (As an aside, I am well aware this is not exactly a Windows "best practice" to put stuff in System32, but that is how it has been done in the application (which is quite old now), and that is what I have to live with given that I have inherited ownership of the project) The trouble is, on my Win 10 dev PC LabVIEW cannot even "see" that directory. If I try and open any files in it I get error 7 (File Not Found), and in fact when I browse to the System32 directory from within LabVIEW the ABCD directory is not even visible. Clearly this some Windows permission problem, but I cannot figure out how to work around it. I have messed about with all the permissions of that directory, and according to Windows my user should have full access to that directory. I have even tried starting LabVIEW as an Administrator but still no joy. Strangely, even from within Windows I can create a new text file in that directory but cannot save it. Any ideas what is going on? Edit: perhaps this has something to do with 32-bit/64-bit compatibility? If I open LabVIEW 64-bit I can see the directory if I browse there and the same LabVIEW code then is able to open and read the file contents just fine. I really did not know directories and files could have a "bitness" assigned to them...
-
And you forgot the sentence termination character. ;-)
-
Ouch. I suspected that could be the case, but was too lazy to google it as I didn't think anybody would be as pedantic as I was being I will try and make better jokes in 2016...
-
Rolf, will this run on versions of LabVIEW greater than 2? My Windows 3 PC is quite dusty. <ducks> Jokes aside I am looking forward to seeing this, thanks for the update.
-
Hi All, I am trying to get a list of files out of a particular build script. I think I am mostly there, but stumbling at the last bit. Attached is my attempt so far. I can get the source tags for the build, but don't know what to convert the variant to. I know it is a reference of some type, but have tried a few things and none of them seem to work. Any tips? Nevermind, figured it out The RefNum is type ProjectItem, converting the variant to this then allows the Path to be read
-
are Boolean expression stopped like they would be in C ?
Neil Pate replied to ArjanWiskerke's topic in LabVIEW General
I think booleans in LabVIEW are stored as bytes, not bits. All bits clear is a false and any other pattern is true. This can lead to some interesting tricks you can play when typecasting in between boolean and characters. -
Not sure if this is of any help to anybody. It is a comparison of a blank VI saved in 2015 32/64-bit Test 1 - 32 bit.vi Test 1 - 64 bit.vi
-
I still don't really get who you are trying to secure yourself against. This seems like a lot of work for very little real reason. I suppose in response to your OP, I am in the don't care category. All my systems that have some kind of network comms are on an intranet, and if somebody else on that network is trying to maliciously ruin my day it really is not my problem. Where I need to expose things to the Internet I would never use raw tcpip. In those circumstances I use Web Services with their built in security features.
-
Years ago I did some embedded programming with pretty basic micros like the 8051, and they had a hardware stack that you would push to and pop from. Maybe this is where I am getting confused, I do not have any formal CS training so have just cobbled together knowledge over time.
-
Jack, this may be obvious to you, but you say the data is posted on the stack (and not the heap). Is that because interruptStruct_t interruptStruct; is declated as a local variable in the function and so automatically uses the stack? I thought the stack was physically a different "type" of memory, more like a L2 cache inside the CPU. A bit of googling tells me not that this is not the case. Computers are complicated...
-
It's discussions like this that make me happy that I do not have to deal with these kinds of situations very often. Luckily for me most of these issues raised probably will not affect my project if I am careful (which I definitely will be!). Really good insight here, I am quite envious of the technical grokking that you fellows have on these quite arcane issues.
-
Shaun, that is in line with the conclusions I reached from my research, so thanks for also confirming it. The code I am interfacing with is not going to change. However if it t does we will just have to rebuild my DLL. Jack, I have gone through some sample code where the two callbacks are implemented. In the Receive callback the function calls malloc/memcpy on the data it is passed in. My plan for my wrapper is to allocate some memory for LabVIEW to use, once in my Init function. Then I will copy the data structure into that memory and PostLVEvent using my copy.
-
Thanks Rolf, This project is a one off. One PC, manually installed once, tested on the final hardware etc. So those software bugs would be found very early in the dev lifecycle and once fixed should never present themselves as a problem. Static linking it is
-
OK experts C experts :-) My goal is to write my wrapper DLL with as least fuss as possible, as my C skills are not great. I have access to the .lib files, it seems to me that life would be easier if I statically linked the additional libraries as then I do not need to mess about with loadlibrary, GetProcAddress etc etc. Is this sensible? Note the code I am going to interface to is quite old, and in all liklihood is not going to change.
-
Thanks for the info everybody. I am going to start looking into this today, I will keep all your suggestions in mind.
-
Rolf, this is a going to stay a 32-bit application for its entire lifetime. There is exactly zero percent chance this will change. So if ShaunR's method works that sounds like the winner to me. I do this kind of DLL interface stuff rarely, so am always struggling to remember the details of pointers and buffers etc. I wan't to try and keep things as simple as possible, and having dealt with memory allocations in the DLL before I would like to try and avoid it if possible. All I need is the data back in LabVIEW via a PostLVUserEvent, I don't think the caller of the callback every expects anything meaningful in return. Now, I have not actually dug any deeper, I have some sample C code that shows the library in use (although here it uses a .lib rather than the DLL, but I expect the function handling to be the same). At some point I am going to need to go through this.
-
Hi Jack, The library I am trying to integrate into my code is a "standard" TCP/IP based message protocol. The only function I need to call that requires the callbacks is the Init. The Init, which is called only once at the start, defines which two other functions are used in the event of a message being received and an error being detected. int Init(LinkType iLinkType, DataProcessingFunc pDataProcessFunc, ErrorProcessingFunc pErrorProcessFunc); As far as I can tell, almost all the other functions in the library are used for configuring the communications or sending data, and all of these are "normal" type calls with no fancy prototypes or crazy structs being passed around. The library itself is cross-platform (I know for a fact it can be compiled to run under Linux), I have access to a "normal" 32-bit Windows DLL (not assembly). I am not sure of the calling convention but I think So my plan was just to wrap up the Init and implement a DataProcessingFunc and ErrorProcessFunc in my DLL, those last two would just pass data straight back to LabVIEW using PostLVEvent. int Send(tyLinkID iLinkID,tyMessage message); tyLinkID is just a plain integrer typedef struct { tyMessageType nMsgType; DWORD nAddress; BYTE *cType; / WORD nTypeLength; BYTE *cData; WORD nDataLength; } tyMessage; I plan on calling the Send function directly from my LabVIEW application. Any problems that you can see from a cursory glance?
-
Subpanels: what are the rules for order of operations?
Neil Pate replied to Aristos Queue's topic in LabVIEW General
Yes, it works like that on my LV2015. The heartbeat light thingy keeps on blinking until the top-level VI is stopped. -
Thanks guys! This is good news as I was not really very excited to wrap every single other function exported by the DLL. I think I will wrap up the Initialise function (this is the one that requires the two callback pointers), and then implement the two callback functions as simple functions to PostLVEvent.
-
I need to implement a certain comms protocol into some software I will be creating. This has been provided for me as a DLL. The problem is that the DLL uses callbacks for the message processing functions, which I cannot easily do from LabVIEW. So my idea was to create a small wrapper DLL which implements the callback functions but sends the data to LabVIEW using PostLVEvent. I will have DLL_A (supplied by my customer), and DLL_A_Wrapper (created by me) Now, something I do not know, can I call DLL_A functions directly from within LabVIEW or do I need to wrap all the DLL_A functions as well? I suppose my question is more like, when LabVIEW loads my wrapper DLL, do two copies of DLL_A exist in memory?
-
I can confirm I have also seen this behaviour recently with LV2015. Manually editing the .lvclass was the only thing that worked for me.