
jmltinc
Members-
Posts
17 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Gallery
Everything posted by jmltinc
-
Serial Communication Question, Please
jmltinc replied to jmltinc's topic in Remote Control, Monitoring and the Internet
ShaunR, I realized that exception 90 minutes after I posted. I removed the property - thanks for the heads-up. Yes, ensegre, the cable is a straight cable and the C++/QT exe works fine. If I increase the byte count, it does time-out and error. I am totally flummoxed as to what might be the problem... Thanks, Folks. -
Serial Communication Question, Please
jmltinc replied to jmltinc's topic in Remote Control, Monitoring and the Internet
Thank you for the thoughts. The radio expects no termination characters. it demands only 5 bytes - four Parameters and the fifth byte being a Hex Command, and 2 Stop Bits (and 4800 Baud, No Parity, No Flow Control). The C++/QT exe built by another to test the radio (changes VFO-B to what is in VFO-A) works fine. I have a USB to RS-232 adapter with a Female DB-9 so I configured it as another Serial Port to read what his exe is spitting-out to make sure my formatting is correct. I wrote a VI to open and read the Com Port and return the string. While I did not do a String to Byte Array conversion, the string outputs exactly what I am sending - the 5 bytes Null, Null, Null, Null, ... (without the commas). This string corresponds with 0,0,0,0,85. I am reasonably sure that the formatting is correct. (Screenshot attached). For the heck of it, I inserted a Property Node after configuring and opening the port to make sure nothing is amiss in the settings. All settings returned are what I set (amended VI attached). If I add the property Is Port Connected, the VI throws a Error-1073807331 The Specified attribute is not defined or supported by the referenced resource. Is it possible that I am missing something in how LabVIEW handles Serial Communications? I appreciate your patience on this. It seems there are several layers to VISA and I may be missing something here. Thank you for your time and insight, John ensegre2.vi Read EXE File.vi -
Serial Communication Question, Please
jmltinc replied to jmltinc's topic in Remote Control, Monitoring and the Internet
I appreciate your quick response and (I think) I recreated your work. But neither command does anything. Is there something I am missing? John ensegre1.vi -
Decades too late, I am just learning RS-232 communication and the only resource that has a Com Port library is LabVIEW. I am having problems understanding how I should send the data and really could use some pointers... I have a Ham radio which I would like to communicate with through the computer. It is as Plain Jane as you can get: 4800 Baud 1 Start Bit 8 Data Bits 2 Stop Bits No Parity No Flow Control The radio expects 5 bytes - the first four are parameters either in BCD or Hex and a fifth Command code in Hex. Any of the four Parameter bytes not needed are padded to provide 5 bytes, which the radio expects. There are two commands I would like to send - one requires only the Hex command (and padded Parameter bytes); the other BCD Parameters. Walk before I run... 1) The easiest is transferring the VFO contents from VFO-A to VFO-B. The Command is 85 (Hex) with the four Parameter bytes padded (I tried zeros). I had a friend create a simple routine in C++ and QT which does this nicely - so the radio works. While I cannot see inside his exe, I presume the 5 bytes are 00 00 00 00 85. 2) The other command is to change VFO-A to the frequency 14.250.00 MHz. The parameters contained the frequency in BCD Packed Decimal) and the Command 0A (Hex) to complete the five bytes. The five bytes are formatted as such: Byte 1: 00 Byte 2: 50 Byte 3: 42 Byte 4: 01 Byte 5: 0A Per the radio manufacturer, sent in this order will change the frequency. But no matter what I try, I cannot even perform the simple task of copying VFO-A to B. I have tried arrays writing within a loop, sending a string, typecasting, flattening - all examples I found online. I don't know how LabVIEW handles data through VISA Write. Worse, the radio manufacturer gives a BASIC example of command 2 (changing frequency) as: Print #2 CHR$(&H00);CHR$H50);CHR$(&H42);CHR$(&H01);CHR$(&HA) I recognize this BASIC syntax as converting Hex into String and sending them off to the Port, but cannot convert this in LabVIEW. Yes, I use VISA Configure Port matching what the radio expects. I think my problem is what I am feed VISA Write - I am hopelessly lost here. I am not even sure 85H is 85 when sent as a string. Are the 5 bytes converted to an array and sent as one string or sent in 5 iterations (if the latter, do I convert a single U8 from a byte array to a string? If there is a conversion, what is it? Thanks for helping the dinosaur. John
-
Thanks for the replies... A INI or text file won't work because my partner won't cooperate I haven't tried a static reference and using its reference. It is an interesting concept. I have tried putting the VI's in the FALSE case of a Case Structure residing outside of the Consumer Loop of the main VI. The conditional terminal is wired to a comparison function that will always call TRUE. Inside the TRUE terminal, I put the Get VI Dependency method which indeed returns the paths which I store in a cluster. Unfortunately, the popups in the FALSE case, even though not directly called, run in memory. When they are called dynamically, they open, but are hung and the main VI must be closed. I will try the Static trick and see what happens. Thanks, -John
-
Hi Folks, I have some popup VIs that can be called by the main VI's menu as well as from the popups themselves. These VIs are not dropped inside any VI, but are called dynamically using their path - either absolute or relative to the caller. My problem is, I do not know where the VIs might be placed at the time of the Build. Without going too deeply into the dirty laundry and politics of our company, the project was divided into 2 parts. One part is concerned with retrieving and writing data to a database (my part). This requires user interaction. My contribution is integrated into a legacy application "owned" by another person. That person controls the main VI as well as the Build and distribution. Unfortunately, he operates autonomously and without communication. Bottom line is I have no idea where he will place the VIs for the build and he may change the location at any future build. I cannot use the Get VI Dependency method because the popups are called dynamically and therefore do not exist on any block diagram. Is there any way to retrieve these paths within an executable at runtime? Yes, I know the answer is to work as a team, but that is not going to happen... Thanks, John
-
smarlow, I went back to your original example in your second post - the image. It was behaving much like my previous attempts (in this case hiding part of the listbox), so I dismissed it. But, I realized it did behave differently and so I added constants to add width and height to the FP. It seems that with some tweaks it will do what is required. Thank you. Now, I need to see what I was doing wrong in the first place! Thank you Hooovahh for your effort. I must not have been clear in my needs. John
-
Thank you for the LV2013 example and your quick response. It is appreciated, hooovahh. Your example works wonderfully for someone resizing the window. Very nice! I think I might use that sometime I am looking to do the opposite, though. The listbox remains anchored and its 'Description' column and row count are resized programmatically depending upon data content, which changes with each level of the BOM. The listbox is limited to 15 rows, then it receives a vertical scrollbar. The 'Description' column is also limited in size, preventing the listbox from becoming too large for the screen. What I am looking to do is programmatically resize the Front Panel as the listbox is also (programmatically) resized so no user input is required. The window/Front panel must expand or contract with the listbox leaving a static margin at the right and bottom. Can this be done? Thanks, again. -John
-
Thank you, hooovahh. I have LV2013, so I was unable to open your example. If I understand you correctly, your code resizes the objects inside the Splitter as the user resizes the window, yes? Perhaps I have this wrong... I do not need to resize the listbox (or two buttons) when the user resizes the window. I need the window to automatically resize about the controls as the listbox is programmatically resized. If I am wrong about what your example does, would you be so kind to send it in 2013? Thanks, -John
-
Thanks All to the replies and sorry I am tardy returning. Perhaps you might be kind enough to give it another go with me? I have a listbox that is resized depending upon with what it is populated. It may have 5 rows; it may have 15 - it may be 600px wide; it may be 1200px wide. The Top/Left position of the listbox never changes - only the Height and Width. There is no Splitter - only two buttons at the bottom of the listbox, each aligned with the outer edge of the listbox. As the listbox resizes, the buttons move in height with the height of the listbox and rightmost one aligning with the right of the listbox. I would like the VI's Front Panel to resize with the listbox to maintain a predetermined margin on the right and bottom; eliminating scrollbars or need for the user to resize the window. When opening the VI it populates the listbox with a first level of a Bill of Materials (BOM). The user selects an item and the listbox is repopulated with items from the next BOM level. This continues until the last level is reached. The listbox will resize in width depending upon the text inside the 'Description' column and in height depending upon how many items (rows) are in that BOM level. No references are needed for this VI. I cannot provide working code as the listbox is driven by data from a database and its operation requires several sub-VI's inside a State Machine for operation. See screenshot of FP layout. Smarlow, I tried your solution, but the Front Panel shrinks to hide most of the listbox. For what it is worth, I already position the buttons so the Cancel button is always at the right of the listbox and the same distance below it no matter the size of the listbox. I had been using that control as my reference to resize the Front Panel. I tried several variations of the same - taking the Height and Width of the cancel, adding it to its Top and Left properties, and then somehow add it to the current Front Panel Bounds, but the window either collapsed or continued to grow with each resize (user clicking on the listbox). I hope there is a solution. Many thanks, -John
-
After a couple days of searching, I have not found an answer to my problem. I have a listbox that loads new data when the user double-clicks on an item. The listbox resizes to accommodate whatever data it may contain - both in width and in row number (both up to a maximum). I want the Front Panel to resize with the listbox keeping a static margin on the right and bottom edges of the listbox. Can anyone help me with this? Thanks, -John
-
Thanks for the replies, Duh. "Single Process" Well, that explains that. My first thought was to use TCP. However, and unless I am missing something here, the 'Master' application would constantly be polling for data. Due to the lag between sent and received data, I cannot have the "Master" close the second app without risk of losing any changes that were recently made, but not received. I must wait until the user closes the second app and have the master check if the second is open or not before proceeding with its database write. Maybe there is a work-around here. In the past, I have passed data using a text file and deleting it upon read - not very elegant. OK, back to the variable. Does anyone know if a Network-Published variable can work in LabVIEW Runtime? Thanks, John
-
Hi Folks, I need help, please. I created a Single Process Shared Variable in the Project Explorer and 2 VIs that write/read to it. One VI writes to the variable, the other reads. Both VIs work as expected when run as Vis in the development environment. If I create Builds for both (or, even one), no data is transferred on my development machine. I changed the variable to a Network-Processed variable and can move data between executables, but only on my development machine. When executed on a Runtime platform, they fail with an error message of not having Enhanced DSC Runtime. I spent hours running in circles - researching, making Builds, you name it. The goal is simple - send data from one LabVIEW exe to another - both on the same machine. Can anyone help? Thanks, -John
-
ensegre, Thank you form the additional information, and once again, my apologies for the tardy reply. I have been working on a priority database project and haven't had the time to continue to explore MV... At some point I will find a hole where I can digest your advice and hopefully you will be gracious enough to answer a few more question that will certainly pop-up. Thanks, again. -John
-
Thank you ensegre for your response and my apologies for my tardy reply. I had a hot project and had to table everything else... A - I am new to this, so let me apologize for my ignorance. Everything I have read suggests 4px. When you say I could make do with 2px/800um are you saying I might require only 2px for a sensor's pixel size of 800um? A - products are 19" wide and vary in length from ~7" to 20". My plan was to image the width and take the length in bites (more than one image). A - I need not image cutouts or other features of different heights at the same time for a single product, but the products that will be imaged have the ROI at different heights, so I guess the answer to your question is yes. I understand DOF is a concern and I would like to avoid having to reposition the camera in the Z axis. As the difference between products can be a couple inches, I expect focus will have to be varied. I was unaware that there was a capability to control focus automatically with Machine Vision Cameras/lenses. May I impose and ask the math for choosing the components I require? I have seen all the formulae, but the individual equations are dependent upon another. I truly do not know where to start. Do I start with sensor size/pixel size? Depth of Field? Field of Vision? Yes, I am pathetic... Thank you for sharing your knowledge. John
-
MichaelH, thank you for the X-Y suggestion. I thought that too, but was hoping for a simpler solution. ensegre, I did use 4px in my calculations. It was a week ago, and my mind has been cluttered with everything from this steep learning curve, I may have made a mistake on the calc or just don't remember (exactly) the pixel count. I am glad that you have allayed my fears of the working distance being a problem. I have no restriction on that. Still: Can I achieve .8mm resolution over a FOV which is ~500mm? Also, you asked if my objects are over a cm deep. I am imaging the placement of PC boards inside chassis of differing depths from 1 1/4" to up to 3". Also, imaged (looking into the open chassis) are machined cut-outs (reliefs) which allow for placement of SMT components on the underneath of the PCB. If the reliefs are not properly machined, the components are shorted. This is really where I need the .8mm specification. Thanks, John
-
Hi Folks, Newb to Lava and Machine Vision. I hope these questions have not been posted before. We have products (RF amplifiers) that are roughly 20" square. I need to image for several things, the most demanding perhaps - edge detection with a tolerance of +/- .8mm. I cannot sell my company on a system that will break the bank and my math says I cannot image the complete unit, but must take it in bites. Additionally, we make several products of different depths, so presumably either the product or the imaging system must be adjustable in the Z-axis with adequate precision. After weeks of reading about selection of sensors and lenses, I haven't answered a basic questions: 1) For resolving to .8mm, what is a reasonable maximum FOV to expect? 2) What is a "normal" Working Distance in such an application? To capture 20" with a 35mm lens, I am at 3'... 3) I think at one point I came up with 11,000 horizontal pixels to achieve what I want to do. Not going to happen either with the imager or processing. What suggestions would be a work-around? Multiple cameras; rotate the product beneath the camera and image quadrants; line scan? While I am trying to walk before running, it is obvious all I am doing is stumbling. All thoughts and suggestions are appreciated. -John