Numberic channel using Dict.Add text conversion

I have several channels that have a text value for them and I used a Dict.add function to change the values of a number so it can be traced linearly.  However, I had to create a separate for each channel in the set data function.  I want to generalize it more so it will come out and watch an all channels and compare the values of the dictionary already created.  I have attached a sample form of how I currently do not change and I played with a new form called TxtToNum.vbs which is more widespread.  I have 6 dictionary that I use in total as well so who plays in the task.   I do a lot of work of script and could really use it little assistance.

Thanks - J

The following should do what you want:

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Digital channel text
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
If programrevision then > 1129
Channel Dim, State, Dict3, t, TXT1
IF Data.Root.ChannelGroups (1). Channels.Count > 0 THEN
FOR each channel in Data.Root.ChannelGroups (1). Channels

IF Trim (UCase (Channel.Properties("DisplayType"). (Value)) = 'TEXT' THEN
Call ConvertTxtToNum (Channel)
Call ValChn (Channel)
END IF

NEXT "channel
END IF ' Any channels at all
END IF ' Version of program

Function ConvertTxtToNum (Channel)

Call Channel.ChannelGroup.Activate
for t = 1 to Channel.Size
IF Dict3.Exists (ChT (t, Channel.Name)) THEN ' compares the value in the value chain in the dictionary
ChT (t, Channel.Name) = Dict3.Item (ChT (t, Channel.Name)) ' changes the key of the element in the dictionary
On the other
ChT (t, Channel.Name) = '0 '.
end if ' dict3
next

End Function ' ConvertTxtToNum()

Function ValChn (oChannel)
Dim sgCmd
Dim ChnNumber: ChnNumber = oChannel.Properties ("number"). Value
sgCmd = 'ch(""#1"") = Val (ch(""#1"")).
sgCmd = Replace (sgCmd, "#1", oChannel.GetReference (eRefTypeIndexName))
Calculate (sgCmd)
End Function

Tags: NI Software

Similar Questions

  • How can I add text on a picture before I print it?

    I've tried everything!  I don't know where to go if I want to add a date or a name to the image and then print the image with the addition of information about this.

    You can add text with Windows Paint.

    Start / Programs / Accessories / Paint.

    Adding text with Microsoft Paint
    http://www.peddlergraphics.com/PaintText.html

    Add text to a picture with Windows Paint
    http://www.pcdon.com/deAddingTexttoaPhoto.html

    Personally... I find Picasa free software to be useful
    to add text to pictures.

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Picasa
    http://Picasa.Google.com/

    After you download and install Picasa...
    Open the program and double left click
    an image to open the editing functions.

    To add text to the front of the photo...
    choose... Simple retouching / text button...

    How to add text to your Photos using Picasa from Google 3
    http://www.ehow.com/how_4599330_text-photos-using-Googles-Picasa.html

  • How to add text to a jpeg image using an iPad Air?

    I want to find an easy way to add text to an image I have on my iPad Air. I have a Bluetooth keyboard to use with it.

    Find a photo editor in the app store, which is in favour. Skitch comes to mind, but there are many others.

  • Hello, I am using windows DVD maker and would like to know thw following: how to add text to the slide show?

    Hello

    The slide show is done but I can't add text can you please let me know if this feature is available

    Hello

    If you use the native windows DVD creation I suggest going through the article in Microsoft and check if that helps.

    Burn a DVD-video using Windows DVD Maker disc

    http://Windows.Microsoft.com/en-us/Windows7/burn-a-DVD-video-disc-with-Windows-DVD-Maker

    (See less to change the DVD menu text)

    See also:

    Work with projects in Windows DVD

    http://Windows.Microsoft.com/en-us/Windows7/work-with-projects-in-Windows-DVD-Maker

    Work with projects in Windows DVD

    http://Windows.Microsoft.com/en-us/Windows7/work-with-projects-in-Windows-DVD-Maker

    Hope this helps and keep us informed if you need help.

  • Try to adjust the text of the labels. Is constantly "could use the tool text because the channel of the target is hidden"?

    Try to adjust the text of the labels. Is constantly "could use the tool text because the channel of the target is hidden"?

    Hi Matthew,

    Go to the Palette layers and make sure all are highlighted, not just one

    Kind regards

    Tanuj

  • Why using the typewriter in acrobat 9 adds less file size that the use of the text of the comment in acrobat 11 tool?

    Why using the typewriter in acrobat 9 adds less file size that the use of the text of the comment in acrobat 11 tool?

    Two employees, one using acrobat 9 and the other uses acrobat 11. The two employees open a secure document one page 105 KB in size. Used using acrobat 9 using the typewriter tool to add comments. Document increases in volume to 137 kb. Second employee using acrobat 11 uses the comment add the text tool (since it is no longer a typewriter tool). This employee has to use tool once and the document immediately increases size of 105 k to 950 + kb. Why is this? What can be done to avoid this?

    As I suspected much earlier, the difference is in the fonts that are used for the text. For the smaller file, text annotation font is Times Roman. that is a policy that is essentially built into Acrobat/Reader. For the larger file, the font is Tahoma, which is not an integrated police force, which ends by happens so the entire police gets embedded in the PDF file. The size of this font on disk file is 681KO on my system (Mac), and it ends up taking more space when they are embedded in the PDF file. The same type of thing happens with form fields and this is done so that all characters in the font are available when the text is changed in a system that may not have the installed font.

    One of the problems is if you try to reduce the size of the file by changing the font that used up one of the built-in ones (Courier, Helvetica, TImes Roman), Acrobat does not remove the now unused of the file font information, if you do not get the reduction in file size that you can imagine, even if the font is no longer presented as being incorporated. I submitted this as a bug some time ago, but it has not been fixed.

  • How can I do a countdown without use the effects > text > numbers?

    I know how to make a countdown using Effects > text > numbers, but that is limited to "30 000" the number.

    I need to count backwards from 6,500,000,000.

    Any ideas how to remove that (and especially the separation with commas)?

    I was about to try this tutorial , but it has the same limit of number 30000.

    Perhaps misunderstood that, although...

    You probably, but not in a strictly formalistic sense. This problem is a general limitation in how deals AE 16-bit double whole precision that affects all the effects / values of the controls (see here for another such case). When you are missing the obvious, is that you don't recognize that for the Visual result no matter how the numbers are generated mathematically, which means that nothing prevents you to use these multiple effects and stringing together to create the illusion. People have done this for years. As an alternative, try to use layers of text and expressions as explained here.

    Mylenium

  • looking to add text to a PDF of the client and print via automation in vb2015

    A client sends drawing files to us. We need to add textual information about the drawing pdf file in order to print the drawing and then process it through our facilities. Information we add from SQL, such as the purchase order date required, etc.. We treat drawings 2-300 an hour. Rather than to score each print by hand, I would use an SDK or another tool that you suggest to open the file, add the text and print the file using VB 2015 by Microsoft. What do you suggest me? What should I buy? I would like to see a sample first or hear from someone who has done this before buying.

    ".. Acrobat is absolutely not for the server... "

    That's right, but I read only the automation of a process is sought and JS and so OLE is built into Acrobat.

    @FMPeck

    There is a basically simple example how you can use the addField method.

    IAB-AMBEIEN http://StackOverflow.com/questions/29085466/Adding-page-numbers-to-PDF-through-VBA-and-ACR

    Example add fields to the date, name of file and page number footer, but can also be used for other text and can also be better formatted. I have written in VBS. So you can copy the code into Notepad, save it as test.vbs, and run it with a double click.

    If it works with your customer a PDF file, you can write on these PDF documents all you want.

    HTH, Reinhard

  • Add text to an excerpt v.8.1?

    I use an excerpt... Version 8.1 (877.7)

    I have problems with the text tool to add text to my PDF documents.

    In previous versions, I was able to click anywhere on the page to create a new text.

    With this new version, I constantly go to the toolbar and click on the "T" to create the new text, which appears only in the middle of the page.

    In addition, I am not able to use the shortcut "Shift + Cmd + T" to activate the text tool.

    Please advise... Thank you...

    With this new version, I constantly go to the toolbar and click on the "T" to create the new text, which appears only in the middle of the page.

    I'm afraid that's how tools work now in the preview.

    Do Apple to know here if you think they should change this behavior:

    http://www.Apple.com/feedback/

  • How can I add text (date, description) to a photo in photo so that it will show on a copy of this picture?

    How can I add text (date, description, etc.) to a photo that she appears on a print that photo?

    Use an image editor as to put on the image preview or add as metadata and print a Board-contact with the metadata fields, you use shown

    LN

  • How to add text to a custom character

    I am a novice at this but found where you can create a custom character after that right click fox mask and adds an image. Looks like you can add text too (it indicates the default text color), but I couldn't understand it. How can I do this? Also there is the online instructions to create a more robust custom character? Thank you very much!

    default test color to set the color of the text of the items menu and other user interface text when a dark image of the Persona is used.

  • How to replace the units of a channel using scripts % 3F

    Hello

    I have a few questions about the manipulation of the channel property 'unit' by scripts.

    Case 1: If the unit in the chain is not specified in the properties, what command should be used to add the inside unit?

    Case 2: When I create using the string ' Call.Root.ChannelGroups (1). Channels.Add ("name", DataTypeFloat64, 1)', empty space of unity being, what other command can be used which was available to the units to the breast?

    Case 3: Consider that I have channel (channel A) with the already defined unit (x), how can I replace the unit with another (y)? (Units of x and there belong to different physical quantities, so the ChnUnitConvert)

    Pls let me know if you nee details on the same.

    Kind regards

    Fazil Shah.

    Hi Fazil,

    The key word for SCRIPT DIAdem units is "unit_string". If you open the SCRIPT and open the channel property list you can select the property unit and drag & drop it in the SCRIPT Editor. This creates the code of script for the property.

    Case 1
    You have the options of towing: a quallified assignment complete or a channel object variable (if you have more settings for the channel of the second alternative is better)

    Data.Root.ChannelGroups (1). Channels ("mychannel"). Properties ("unit_string"). Value = "MyUnit.

    or

    Dim oChn
    Set oChn = Data.Root.ChannelGroups (x). Channels ("mychannel")
    oChn.Properties ("unit_string"). Value = "MyUnit.

    case 2
    You must add the unit after the creation of the channel

    Set oChn = Data.Root.ChannelGroups (x). Channels.Add ("MyChannel", DataTypeChnFloat64)
    oChn.Properties ("unit_string"). Value = "MyUnit.

    case 3
    It's the same as case 1 or if you do not want to use an already existing channel device, it can look like this

    oChnA.Properties ("unit_string"). Value = oChnB.Properties ("unit_string"). Value

    I hope that answers your questions

    Greetings

    Walter

  • Is there an easy way to add text to a chain control / indicator and keep the colors

    Hello

    Bassically I want to add text to a chain control / indicator without losing the formatting of the previous text.

    For a part of a program that I create, data will be transmitted to and from a serial device. I want to display this data in a chain control / indicator and change the color of the text of certain strings depending on data type (sent, received). Basically as a nice log window.

    At the moment, I update the chain control / indicator by reading the text and concatenated with the new string. However, this method removes the colors of previous text :-(

    Is it possible to add data to the control of the chain / indicator without losing the text previous formatting?

    I started to create a sub vi who reads a text both character and adds a new element in an array (offset color and text), if the color is distinguished by the previous character. Only problem is it seems to be quite time CPU.

    Thanks in advance,

    Matt

    MattB-5906 wrote:

    Is it possible to add data to the control of the chain / indicator without losing the text previous formatting?

    Actually, no. This means that you will have to use workarounds. Your workaround solution seems a bit involved. Basically, all you need to do is just to keep track of the pairs of end start/selection selection that must be colored in a table. Then just you loop in this table to color the text marked by the power positions.

    An alternative is to use a different indicator. Rather than an indicator of the string, you can use a table with a column. You can then set the foreground color on a cell by cell basis, and add a new line (row) will not affect the coloration of the previous lines.

  • How to add text to my video instead of creating Notes?

    I'm trying to add text to my video because I'm not like the notes thing anyone know how?

    Hi Miss'Fiona,.

    What software do you use?

    You can use your favorite search engine to find the third-party software to enter subtitles or add text in video.

    Note:   software use of third parties, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

  • How can I add text to photos save to JPEG? The photos have been imported into my computer from a mobile phone

    How can I add text to photos save to JPEG? The photos have been imported into my computer from a mobile phone

    Hello

    What operating system do you use?

    You can use the paint on windows feature to add text on the pictures.

    Reference:
    http://Windows.Microsoft.com/en-us/Windows7/products/features/paint (you can also use this article for windows vista)
    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/app_paintbrush.mspx?mfr=true
    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/mspaint_overview.mspx?mfr=true

Maybe you are looking for

  • How to stop Motion 5 to rename the items?

    How to stop Motion 5 to rename the items? For example, I have a folder named "Box" inside this folder are 5 additional folders and in these files are text and circles/squares etc.  Once I have copy and insert the name of the parent is "copy of zone 1

  • The Clip + supports Vorbis FLAC comments?

    I searched the forums but could not find conclusive evidence that the Clip + supports Vorbis comments that are the official standard for files FLAC.  99% of my library is in format FLAC with Vorbis comment tags only.

  • Addresses MAC to FI FI

    We had a setup consultant our infrastructure of Hyper-V, SCVMM, and there apparently did not set out properly switch HV. Long story short, the consultant set up the consolidation of NETWORK cards and our independent switch vSwitch tenant with LB of d

  • Visual Studio 2013 has stopped working

    Hello Because I applied an update on my Windows 8 (update system when you stop/restart your computer), I can not start my Visual Studio Professional 2013 RC. Whenever I try to start VS2013, it displays the start-up screen and then the main window. Af

  • wfAction rejection does not work

    I have two steps in the workflow... If the document is rejected in step 2, you should refresh a data such as meta value below: < wfAction as "REJECT" If $>< $wfUpdateMetaData("xsrt_bill_status","Re-Submit")$ >< $endif$ > I tried this code in the entr