Jump to content

postformac

Members
  • Posts

    40
  • Joined

  • Last visited

Everything posted by postformac

  1. Hi, thanks for the reply. I can do that and it accepts the different data type but then how do I get my table to display the contents of the cluster? Is there a way to convert from a cluster to "dynamic data?"?
  2. Hi, I have my LV program taking a number of readings from two channels on an external device and displaying them through two numeric indicators. This works fine and I can build the readings into a 2D array for display in a table or logging to a file. I want to add time stamps for each set of readings but am having difficulty with the data types as time stamps seem to have their own specific type. I cant simply add the time stamp as an element in my array as it gives me errors with broken wires. I have tried convering the time stamp to a numeric value and it works but it no longer looks like a recognisable time stamp. I have also tried converting my time stamp to a string and both my numeric inputs to strings which then enables me to build them all together in a 2D array but I can't get it into the correct dynamic data type for use in the table. I have also tried using the "include time stamp" option in the build table function, but this gives me a separate time stamp for each of my input elements, so I get two time stamps per row when I only want one. What I am trying to achieve is to display a table that shows both of my measurements and a single time stamp on each row Thanks
  3. Thanks very much, that fixed it. I wonder why they have left it like that in the example program provided with the software? And yes, you're right, I meant coercion dots not incursion dots :headbang: Thanks again
  4. Hi, I have my Labview program communicating with an external device and it all works well, however I have one incursion dot on the VISA configure serial port sub-VI. The incursion dot is on the "parity" setting, which according to the help should be set to a zero for no parity. From looking at the sub-VI itself it is expecting an unsigned word (16 bit) input which is what I have the data type of my input set to. I notice that this incursion dot is also present in the simple serial read and write example program supplied with LV, so I'm obviously not the only one that has this problem! Is there any way to get rid of this red dot? Its not causing any issues but its the last incursion dot left in my whole project and I'm just generally picky Thanks
  5. Thanks for the reply. I had tried it set like that, and was getting the data back as I described in the original post. However, I just tried with a new VI as a test and it works fine. I went back to the original VI and checked all the settings, which were the same, but that was still adding zeros on the end when there was a leading zero (ie. "1.023" would read "1.0230") I went into the advanced editing mode and found that on the new VI it had "%.3f" as the format string but on the original it had "%_3f". I changed it manually and it works perfectly now, not sure what caused that! Thanks anyway
  6. Hi, I'm reading a floating point number from an external source over serial (its a PIC giving a voltage reading as an ASCII string output) It works great but I am having difficulty finding a way to display the data to a set number of decimal places. I have tried changing my indicator to a number of different display formats, but they all have issues with certain values. For example, if my incoming string reads "1.123" and I set my display format to floating point with 3 digits of precision, don't hide trailing zeros, it works perfectly and shows "1.123" on my indicator. If the incoming string reads "1.023" it then displays "1.0230" on my indicator, I assume that it doesn't count the first zero as a digit. If I hide trailing zeros then it works with either of the above examples but if the string reads "1.100" then I just get "1.1" on my indicator. Either way the number of digits on my indicator changes according to the data coming in. I just want it to show 3 decimal places, so either "1.123", "1.023" or "1.100" depending on the input string. Is there any way to fix it like this? I don't want the display to keep changing the number of digits after the decimal point. Thanks
  7. Oh yeah..... Idiot lol Thats fixed that then, thanks!
  8. Ok, next question on a similar theme but working the other way.... If I am receiving a floating point number in ASCII format through my serial port, is there a simple way to turn this into a floating point numerical value for display through a numeric indicator? For example, if I receive "1.123" in ASCII format and want it displayed as "1.123" on a numeric indicator. I tried using the "convert string to decimal number" function and it seems to not recognise the decimal point, I get a value of "1.000" out of my display. I have currently got round this by taking the string one byte at a time and manually looking for the decimal point, then dividing whatever is after the point by 1000 and adding it to whatever was before the point, which works fine. Another way I thought of doing it is to split the number in my external hardware before transmission and design the comms routine to recognise which bits are whole numbers and which are after the decimal point and then div by 1000 and add again. Can't help thinking there must be a simpler way though, is there any inbuilt function that will recognise the signed decimal floating point string and output it to my indicator correctly?
  9. Brilliant, thanks guys, got it working at last! I actually went with the byte array and byte array to string conversion method as the data to be sent is coming in as numeric data from other parts of my program where I am using it to switch case structures. Either way its all functioning properly now... Cheers :worship:
  10. Hi, I am doing some basic comms between my PC and some hardware I have made using the VISA serial write function. It all works fine and I have no problem sending data as long as the data I want to send is is ASCII format. My problem comes when I want to simply write a specific byte to the serial out WITHOUT it being converted to ASCII. For example if I want to write a hex number 0x05 (which would be interpreted in ASCII as an ENQ) it gets sent out as ASCII "5" (ie. 35 in hex). My hardware is looking for a hex value of 0x05 to come in the serial port which it then never gets (as obviously it receives 0x35 instead). Is there any way to get my LV serial write to just write a specific byte without applying the ASCII conversion? Thanks
  11. Mark, Sorry, I think we are crossing wires somewhere.... I have two lots of data, one lot of input data in a 2D array of integers which is stored as integers and displayed as integers, no problems there. The input data is analysed by my code and the results are output into a separate table (not an array). The output results in the table should also be integers as they simply list element numbers and values from the input array, the problem that I was having was that the output table (as an actual table indicator not a 2D array indicator) was showing the output data as floating point instead of integer values. I fixed that by changing the "format for numeric table data" found in the properties of the "build table" block on the block diagram. I realise I could have just made the input array floating point but that would just use up more memory space and should not have been necessary. I was still having a problem however as the table requires an input of dynamic data type. When you add the table it automatically includes a "convert to dynamic data" block to swap whatever data you have into dynamic data. The only options for data types to input into the "convert to dynamic data" block are boolean and floating point, no option for simple integer values. It still worked but I had the coercion dot. Now following Nevilles' suggestion (thanks) I have added a block that converts from integer to double float just before the dynamic data block. That has removed the coercion dot, I am wondering though if it increases memory usage? Not that its really an issue as there isn't that much data being processed but I code a lot of embedded stuff so I'm just used to always using the smallest possible data type for whatever I need. Is the conversion only temporary until it is output in the table or is the converted (and now expanded) data held in memory still? Thanks both for all the help!
  12. Thanks but the data type of the array is correct to only be integer numbers, I want to change the display of the table and the option to change the display format is not given on the right click menu for the table. Oh actually I found it, I can right click on the table in the block daigram and change the data type to integer. I still have the red dot on the "convert to dynamic data" block though and the only options on the properties for input data are still floating point and boolean. Is there any way to fix that? Thanks
  13. Actually, one more question on the tables - I am building my table from a 2D array of integers (ie. no decimal places and the arrays used are set to "long" representation). It works fine but the data in the table is displayed to 6 decimal places which is pointless considering the input data. I know how to change the data type of numeric controls / indicators using the representation setting but I cant figure out how to change this for the table. There is no representation option on the right-click menu and in the block diagram the "convert to dynamic data" block that appears infront of the "build table" block only gives the options for the scalar data type to be either floating point or boolean. Is there a way to change this so that the table just displays integers without the decimal point? The way it is at the moment also causes a red dot at the connection point on the "convert to dynamic data" block which I assume is due to the mismatch in data types? Thanks
  14. Oh ok, thanks. I hadn't actually built it yet I was just running it from the development environment, I didn't realise the edit would be disabled once it was built! That solves that then....
  15. Hi, I am new to labview and am currently working on a project that analyses the data from an input array and lists the analysis in a table (lists array element positions and values that fall ouside of a pre-defined spec). It all works fine, however I want to stop the user from being able to edit the table data after the program has run as having output data editable by the user kind of defeats the purpose of analysing it in the first place.... The table is set as an indicator, I know I can do this by outputting as a 2D array instead of a table but then I don't get the column headings. Is there any way to do this or are tables (even as indicators) always editable? Thanks
×
×
  • Create New...

Important Information

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