Jump to content

Matt_AM

Members
  • Posts

    17
  • Joined

  • Last visited

LabVIEW Information

  • Version
    LabVIEW 2015
  • Since
    2011

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Matt_AM's Achievements

Rookie

Rookie (2/14)

  • Reacting Well Rare
  • Dedicated Rare
  • Collaborator Rare
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. I went to see how the executable pathing and stuff works and I am not seeing an error with my current setup and I believe that it should work in dev and executable form. I wanted to get a second set of eyes on my modifications to Create VISA based Class modifications to make sure I did the change over from my original wrong method to the new correct method properly and that the new method will work with RTW and dev environment. I modified the Create VISA based Class to get it's path then did relative pathing from there to access the child classes on my dev stand. I added two temporary path indicators to see where the VI's paths is and what the modified path to the child class is. When I build the executable, I set the startup VI as the Create VISA bases Class and always included the PS 2-0 Class and all children except the DLM_125_32e. The files created on disc for the executable don't have the data subfolder for dependencies (so the bad DLL isn't being called). When I run the executable, I am not getting an error. Below are images of my back panel, then the executable's Source Files, then the executable running with my simulation child and TDK Genesis child. The image of the executable FPs is to show that the simulation works fine and that the TDK fails because I'm not actually talking to TDK Genesis. Note, the Simulation class doesn't actually call any code, but I would imagine that if the pathing is wrong, there would be an error when using DD to override the generic PS 2-0 Class's Init Class. Additionally, I did probe the line coming out of the "To More Specific" VI and the "Actual Data Type" is set to the correct child class, refence image below for the probe. Matt
  2. To be honest, its because I don't know any better. Typically I use the application directory go to support things like the python scripts I need to call for my actual application code. With RTE, I've noticed the directory path is typically something like C:/.../[Project Name]/Main Proj/[executable name].exe compared to the dev path of C:/.../[Project Name]/Main Proj. I realize application path is based on my file structure, but I'm trying to give the concrete example that the executable typically needs a different pathing than my dev environment, see image below of the conditional disable structure I use to access the python scripts. Digressing, I am not sure how LV handles pathing when building an exe to reference a child class. Below is an image of my code for the Update Current method. It is the default PS 2-0 Vi and it launches an asynchronous call to a PS 2-0 popup to let the user know that the method doesn't exist (TBF, I have this as always needs to be override, but the OVP is the exact same logic with a different message). If I grab the PS 2-0 Create VISA based class's path like the image below then strip and rebuild accordingly, will that work in both RTE and dev environment? I am not sure how I can access the child classes in the RTE once I put the child classes into the "always include" section via relative pathing. Do I reference my classes in the dev environment or do I have to include them in the "data" subdirectory that gets created with the exe? I am assuming that I will have to include the classes in the data subfolder of the executable then path to it like I do for the python scripts with the conditional disable structure to get the correct path to the child class.
  3. Thanks for the quick response. After I sent that message I thought a bit and I 100% agree. I edited my previous post but wasn't fast enough for your response. Going off my previous post's edit towards the bottom (which wasn't there when you responded originally, my bad), how should I do my relative pathing? Quoting the edit I made below
  4. Question about OO, because I think I am doing it wrong. In my parent PS 2-0 class' Create VISA based Class, I am using an enum to grab the proper child at run time by dropping the child into a case based off of the enum? Is this the proper method (image below). I think I remember reading something somewhere that you should use the "get default class" vi when doing this architecture. Again, I'm new to OO so if my design is wrong, please let me know so I can make it better. Edit: To be honest, I feel like my current method breaks the idea that OO doesn't need all the children to run properly where as my current method does. It worked for me so I never really questioned it until now. I included my thoughts about my design and why it's failing at the bottom of this post. I think I need to use the Get Class default value with relative pathing to call the proper child class. Additionally, if one method is called from the parent class for a child, will all associated methods for the parent and children be called as well? I'm sure that statement is word salad to people who understand OO better than I, but I am trying to ask that if I call my Set PS Voltage macro, will the all child classes associated with the PS 2-0 class be loaded into the executable as well based on my current design? (see image below). Edit: Explicit additional info. I am trying to ask if the DHP Set PS Voltage is called, will the DLM_32_125e Set PS Voltage also be called with my current initialize code the designed the way that I did? Additionally, I am not sure if other methods are included with this executable like the Create VISA based Class. In other words, since I am calling the Set PS Voltage, is only Set PS Voltage for the DHP class loaded into the executable in this case? For additionally information, I have removed the DLM_32_125e from the always include section as well as the dll. I just want to verify that in my current test executable, that the code only calls the DHP Set PS Voltage so I can verify that the DLM_32_125e class doesn't have its code being include which could cause my problem. Below is an image of the executable's always include section. As you can see, the DLM_32_125e is still in the Project files and I am not sure if I need to fully remove it from my project or not. When I go to the Preview tab, it looks like the code is still calling the DLM_32_125e. I am assuming I need to fully remove it from my project for it to work properly. Edit: With the way the executable is set up and how I designed the code, I think I understand why the dll is being include. Since I am including the child class in my PS 2-0 Create VISA based Class AND am including that class in my executable via the Source Files tab, that it would make sense that all of my classes need to be included in my executable. I think I need to go down relative pathing to call the proper child class in my enum case. I just want to make sure I am going down the correct path. Additionally, since RTE uses a different pathing schematic, will I need to include a conditional disable diagram to grab the proper class in dev and RTE? I am assuming yes. I use application directory as my starting point for relative pathing typically, should I use that or the VI path in this case. I'm not sure which pathing is correct in an executable while also wanting my pathing relative to my PS 2-0 Class due to the folder hierarchy I have (image below).
  5. My heros! I removed the DLM_32_125e class from my executable and it runs on the deployed PC, we are working again! Thank you so for much for responding. I didn't know about the dependency walker and that is incredibly helpful. Like I said earlier, I haven't really worked with executables and installers and knowing that information is vitally important. Also, thank you for the explanation about DLLs and LabWindows/CVI. I have never really worked with that software before and I know it exists, but thats about it. I contacted Ametek about the LabWindows/CVI version it was built with, but I have a feeling that they dont know. Not trying to throw shade, but the DLM 32 125e is a Sorenson PS. If the story I've heard from the older coworkers is true, Soreson was bought out by Ametek a while ago. I don't have high hopes that they know what version they used. Edit: I lied. I forgot to enable the PS 2-0 disable diagram and I am still not being able to execute my code 😕 You guys are still heros though!
  6. I am not sure how to check for that. Although I've used LV for a long time, I haven't really needed to build executables or installers. I do include all my classes in my executable and I believe that all the dlls should be included as well. The image below is from the secondary executable and is meant to show that I am including all the common classes. As far as I can tell, the SNDCSDLM.dll is the only dll that is associated with my PS 2-0 class and that is set to be always included. Additionally, it populates in the data subfolder of the executable when the executable is built.
  7. Hey Fancy Folk, I am running into an executable error that I was hoping someone could point me in the right direction to start troubleshooting. TLDR: I can build and deploy an executable on my PC and another dev PC and the executable runs fine. However, when I deploy it on a PC without a full LV dev kit, I get error 46308 and it states that the PC needs a full development version of LV to run. I have narrowed my problem down to my code calling my PS 2-0 class through building a secondary executable and including different classes to see what is causing my problem. Long version: I've been troubleshooting this problem for about a week now and I feel like I am still lost in the woods. I have posted it over on the official NI forums here, but I haven't had success in solving the problem. I built the executable and an installer and installed said installer on a new PC (booted up for the first time 2 weeks ago). I have also installed Python 3.9 and the required toolkits so the python code can execute. I did not add anything to the OS pathing found on this white page. I am not sure if I did any pathing on my dev PC or the dev PC that was running the original test and when I checked the dev PC, nothing popped out that looks like I would have added it. The executable runs fine on my PC and other dev PCs but won't work on the new PC (deployed PC). My code uses DAQmx, Python, and COM VISAs and Instr VISAs. I have added in all the individual parts and things work as expected. However, when I add in my PS 2-0 class, I get error 46308 which states the executable needs a full development copy of LabVIEW to run. I have tried various things to solve my problem, but I am still getting the same error. I created a secondary executable and added in my Python classes and children, State machine classes and children, and PS 2-0 classes and children and rebuilt/deployed in sections. When I add in the PS 2-0 class, the executable gives me the error. I have verified there are no breakpoints in my code with VI analyzer and I ran that on the PS 2-0 classes and the dependencies section of the project to verify there were no breakpoints still set. It looks like no matter which PS 2-0 child class I use will cause my error. I'm not sure what I need to provide for someone to help with the troubleshooting process. I am assuming you'd need my PS 2-0 class and I can provide that if needed. None of it is proprietary and its basically an abstract factory architecture for the PS 2-0 class with DD to override based on the child PS 2-0 class. All the Children classes call the drivers from the MFC and I haven't added anything besides a wrappers to the MFC's VI's. I will say that some of the driver VIs are built for old version of LV so there may be some issues with those drivers? The code is attached to this post. I seem to still have an issue with the SNDCSDLM.dll file being called from the 2022 instr.vi, but it is also included in the zip file. Note, I'm still failry new to OO and this was my first attempt at it. let me know if I did a bad job because I can't get better without learning from people who are better than me. The last thing I tried was looking at the way I am doing an async call to a popup (code below). I found an article that showed which VI server property and methods aren't available in the RTE and I noticed that VI Path and VI Name are two of those, but it looks like those can't be called under specific circumstances. I added this code directly to a secondary executable that I've been using to see which part of my code is throwing the error. This VI is a simple 2 button state machine (inc a counter and stop the event struct) with the timeout case never being called. The timeout case is there to get the various parts of my code to "be seen by the RTE" (IDK the proper jargon). Below is an image of the secondary exe's VI back panel which shows that the above code from the PS 2-0 class is being loaded into the exe. In this state, the secondary exe can be run just fine on the deployed PC. However, if I enable the the disabled state (which allows a child class to call a macro to set the voltage), that will cause my executable to throw the error on the deployed PC. I don't think its an OO problem because the python and state machine classes don't cause issues and also use DD for children to override parent methods. Literally any direction is helpful because I feel like I've been bashing my head against google for waaaay too long and although I've made progress as to which section is failing, I still have 0 idea as to why my PS 2-0 Class could cause issues. At this point I think it could be something with VI properties in my PS 2-0 children or their dependencies. Thanks Matt 545624572_Matt_AMPS2-0code.zip
  8. Darren, Thanks for clearing that up! As I was thinking through everything I got onto the mindset that "singleton" isn't "sub module" specific but project specific. Meaning that if I had a singleton PS sub module nested in my "Power and IG" module, then only 1 PS class could exist throughout the entire project and not per cloneable Power and IG module (which having 1 copy of the PS submodule per Power and IG module is the desired result). Matt
  9. Darren, That is what I was thinking too. I wasn't sure if the DQMH used singleton to mean in the entire project, or specific to a module. IIRC, singleton in general means 1 copy of this object exists ever. However, I wasn't sure of "PS Class" being a "sub module" would affect the singleton to mean 1 copy exists for this main module. I assumed not but wanted to verify. Matt
  10. Hey Fancy Folk, Back at it with a question regarding DQMH and how to properly set up code. Long story short, I am creating a "power and IG" module for some motors. This module will contain a module for a "PS class" that I've already created (class, not module) and I'm trying to figure out if I should make the "PS class" module a singleton or cloneable. The high level view is that the code would have a controller which requests to the "Power and IG" module which would request to the "PS class" module. The "PS class" module would then broadcast to the "Power and IG" module which would broadcast back to the controller. This way everything gets passed down/up 1 level at a time. The "Power and IG" module will be cloneable because there can be multiple copies of this module for one test stand. However, I only want each "Power and IG" module to have 1 instance of the "PS class" module. I was originally thinking of making the "Power and IG module" cloneable but the "PS class" module singleton. The issue I see with this is that I am going to be creating multiple singleton "PS class" modules for when I have multiple "Power and IG" modules and I think that is going to cause the code to fail. Therefore, I am thinking about making both the "Power and IG" and "PS class" cloneable to be safe. Thanks, Matt
  11. drjdpowell, I don't think I understand what you are saying. All I can think of is rebroadcasting the data vs broadcasting the user event to. To give some details, A is the "post office" handling user events between B and C. B has a helper loop reading XNET as an XY and C is the test's state machine. Since C is expecting the XNET type of XY, B would broadcast it's XY to A, then A would rebroadcast that XY to C. In this case A is just forwarding the user event from B to C without actually doing any work on it. joerghampel, I thought the EHL was the "top loop" that listens to user events or button presses via the event loop. The EHL would then send a message via queue to the "lower loop" of the MHL which would then be the primary place where you "do the work" of the module. Regrading the helper loop reccomendation, it sounds like the helper loop would be triggered by the user events of a different module...? The way that I have been imagining the helper loop, it would set some timeout/flag to start and stop the module via the EHL getting a request to start broadcasting which sends a message to the MHL to set the flag to initialize the helper loops. Likewise when the code needs to stop, the EHL sends a message to MHL which sends the flag to the helper loop. This feels a bit cumbersome, but thats how I am currently visualizing the process.
  12. Hey fancy folk, I've been looking into the DQMH architecture a bit and I'm thinking about designing a test around it. Basic test background, I am have a motor driving another motor and I'll be reading and writing over CAN for both motors and reading an analog in. I have laid out the basic module diagram as far as who is requesting what and who needs to broadcast their data. I'm currently running into 2 issues that I'm someone can provide some insight on. First Issues - constant broadcast helper loop I will be have 3 read loops broadcasting their data to an "XY Module" (the data will get formatted in the XY style and stored in a circular buffer) which the XY module will broadcast the circular buffer to the "Main Module". My issue is how do I do the constant read properly? I have 2 basic ideas. First is to create a helper loop that is started from the MHL and that helper loop continually broadcasts the message. Second is to use the MHL timeout to do my read (set the timeout from -1 to say 100ms once the module is started). IIRC, best practice is to have the helper loop do your repetitive actions, but by having my helper loop broadcast, I feel like I'm taking away from the main design that the MHL is supposed to broadcast. I am currently leaning towards the second option since I'm not too worried if my read is a bit of. For example, say another action got sent to the MHL (request sent to EHL which sends action to MHL) and the action takes 10 ms, the timing should be: read, wait X of 100 ms for MHL to receive action, do action in 10 ms, timeout 100 ms, read. This would result in a 110+X ms between the reads. I'm not worries about the 10+X ms between reads since my "test cycle" is on the side of 6 seconds. I'm just trying to make sure I understand the drawback of method 2. Second Issue - prevent circular messaging I was reading about the best practices and they were saying that modules shouldn't have circular referencing. In my project, I was going to have a set up of module A requests module B who broadcasts back to A and requests module C who broadcasts back to A. I could go into more of the specifics if you want, but this is the basic idea. Instead what I'm thining about is s Module A requests Module B, Module B broadcasts back to Module A, Module A sees the broadcast and sends the request to Module C. In this scenario, Module A seems more like a "post office" for the messages/user events being sent back and forth. I think its a bit cumbersome, but I also like how all the module controls stems from the "post office" since the submodules will only get their requests from the main module. Any additional insight would be much appreciated, Matt
  13. Agreed completely. I understand that DD is basically allowing the child to redefine a method via overwrite or extend it via overwrite w/ calling the parent's method. Because of this, as you said, all the connector panes for the DD VI must be the exact same. So, if I want to be able to read multiple types of data from a class, DD won't work for a genera "read", hence my question. You are correct, this is basically what I am thinking. I think having a separate read type class that implements how the data is read, or its strategy, is how I can get around multiple read types. From there I was thinking about sending the data via queue to a different "display class". This way, the read type class can have a DD VI called read, where it calls the child class read function (XNET signal/frame/XY) and send it to the display via queue. The queue control will most likely be a variant and enum, variant being the data read from read type and enum being the read type it came from (I've seen that I'm not supposed to send classes via queues so this is my work around to properly cast my variant to the correct data). When I was talking about events/queues, I mean more like a queue to send my data (not read) or an event struct with a 0ms timeout to monitor if a stop condition occurred. I understand I don't want to induce additional delays in my read to avoid timeouts.
  14. This is where my hiccup is, I am using the factory template for my power supply class since I know what my outputs and inputs are. I can use the DD to set/read my voltage, current, or output state since I know they will be double, double, and boolean respectively. I was thinking about using the factory pattern for an XNET Read class, but there are 3 basic methods to read from XNET - signal, frame, and XY. Theoretically, i could force all of these into an XY format. I am trying to figure out how I can use something like a dynamic dispatch to read anything from XNET without having to create 3 specific XNET read subclasses to an XNET read class. And then taking that further, what about a generic read class where I could read DAQmx data as well as XNET data? My current thought is so have a "Read" and "Read Type" class used to build my XNET read. Read would be an abstract class containing queues and events so my Read Type Class knows where to send the data. Read Type would be another class that would implement how I want to read this specific type of class. For example, Read Tye could be XNET signal/frame/XY or DAQmx Analog/digital/counter since the read type class is my strategy of how I want to read my data.
  15. @MikaelH Thanks for the links good sir, I appreciate it! @ThomasGutzler What do you mean by "Returning different data types from classes of the same instrument type is something you don't want."? I'm assuming you mean something like use the parent "Power Supply" object for my connector panes and define the child (such as TDK Lambda) during the initialization section of my test. This way the if I wanted to change the PS from TDK Lambda to say Sorenson, all I'd have to do is change the test's initialization section since all my connector panes are using the Power Supply parent class in their connector pane. If this is the case, I am doing that already, I may just be bad with my vocabulary. @drjdpowell Fair point, learning to walk makes running a lot easier. I guess what I am currently trying to do is define my end goal and figure out the different steps along the way. Then start working on the individual steps to build up to my end goal. Like for a generic motor (in my case) I'll need a power supply class and CAN communication class as my main two classes along with some other private methods/data (ignition task and methods, motor info, stuff like that). As far as the CAN coms, I am actually running into a bit of an issue trying to figure out how exactly I want to lay it out. I'm using XNET and I'm trying to figure out how I should handle having things like single point signal/frame as well as queued signal/frame. If I go down the splitting out all of those into their own child class, then I'm going to have 4 child classes for my basic XNET write class. OR I could try and go into a strategy pattern where the XNET class has some other class information that contains how the data is supposed to be written (something like the CookingStrategyPattern from here.) Thanks all for responding, I appreciate the help!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.