Jump to content

ned

Members
  • Posts

    571
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by ned

  1. QUOTE(Thang Nguyen @ Sep 12 2007, 01:33 PM)

    I tried to create a test project to test the modbus but it doesn't work. Could you help me?

    In the target, I create a library. After that I create a Modbus Slave I/O Server. Then I create a shared variable bind to this modbus. In Target VI, I write the value to this shared variable. In the host VI, I read data from this VI. The issue is I only get value "1" from this shared variable with watever this shared variable is updated in the target.

    I attach here all of the necessary images.

    Unfortunately I don't have access to a FieldPoint module to test this. I just switched jobs, and the last thing I did at the previous company was to set up Modbus communication over a serial link between a FieldPoint module and an autodialer - and it worked. However I was testing this using the configuration tool for the autodialer, which let me read the Modbus values directly.

    This looks to me more like a shared-variable problem than a modbus problem, since you aren't verifying modbus communication. Have you checked for an error in the error-out clusters? Do you have the Shared Variable Engine and whatever else it needs installed on your FieldPoint module? It looks like you're hosting the StopFP1 variable on your computer; does that work? What happens if you instead host both variables on the FieldPoint module?

  2. QUOTE(Thang Nguyen @ Sep 10 2007, 12:54 PM)

    I have just thought about make each cFP work independentl with modbus server inside and run with deployed real-time program. Each cFP will have a range of data address shared variable. But I don't know that if all of these modbus servers can be combined to become one?

    It would be easy to combine all the modules into one modbus server because FieldPoint IO items are treated identically regardless of whether they are local (directly connected to the network module) or remote. You could put all your shared variables, bound to a Modbus I/O server, on one of your Fieldpoint modules, and let that module retrieve data from all your other modules over your ethernet network. You'll only need code on one module, and all the other other modules can have "dumb" network interfaces (the cFP-1804/1808).

  3. QUOTE(abuch06 @ Aug 9 2007, 10:12 AM)

    http://forums.lavag.org/index.php?act=attach&type=post&id=6579''>http://forums.lavag.org/index.php?act=attach&type=post&id=6579'>http://forums.lavag.org/index.php?act=attach&type=post&id=6579

    A typecast node coerces data from one type to another, so long as as the representations in memory are compatible. For example, you can take an array of U16 and typecast it to an array of U8 (the array length will be doubled), because a U16 in memory is stored identically to two consecutive U8s. See the help for more details.

  4. No, but if your array consists entirely of fixed-size types (booleans, numerics, and clusters containing only those types), then you can use a typecast node to convert the array to a cluster without having to set the number of elements.

  5. The LabVIEW help says that you can assign a port to a specific network card, but you are not required to do so. If you do not, it will listen on all available interfaces. Take a look at the help for TCP Create Listener and UDP Open, specifically the "net address" terminal.

  6. QUOTE(i2dx @ Jul 5 2007, 09:11 AM)

    Hi Folks,

    I'm trying to implement a "Host to Target" (which means: RT to FPGA) DMA Transfer on a cRIO 9004 controler with a 3M-Gate chassis. The FPGA VI compiles without errors, but when I start my RT-VI I get the error -63001, which is explained as "DMA from host to FPGA target is not supported for this platform".

    Has anyone made similar experiences or (hopefully) has someone allready successfully implemented a Host to Target DMA on a cRIO 9004 controler?

    Thank you,

    CB

    The error message you're seeing is accurate. The 9004 allows DMA transfers only from FPGA to RT, not the other direction. Host to Target DMA is a new feature of the 9012/9014 cRIO controllers and is not supported on the older controllers.

  7. QUOTE(DDAdevil @ Jun 20 2007, 11:48 AM)

    I have a program I need to run on one computer that uses the DAQ Ni software to read data and is wired into a laboratory. I want to be able to view the same front panel display screen and access this from different computers that are networked. I believe it is more complicated than merely having an .exe file on labview capable computers that are networked as only one program can be reading the data from the inputs at a time. Any help on this process would be appreciated.

    It's not quite clear what you want to do here: will each of the networked computers display exactly the same data, or do the networked computers each need access to the data so they can act on it differently? For the first case, any of the remote viewing options mentioned (Remote Desktop, Remote Front Panels, VNC, etc) will work. If you don't like any of those options, or your needs fall under the second case, I'd suggest that you split your code into two parts: 1) a server that reads your DAQ data, accepts connections, and responds with the acquired data, and 2) a viewer application that retrieves data from the server. You can use shared variables, DataSocket, or a custom TCP or UDP protocol to distribute the data to all instances of the viewer application.

  8. QUOTE(Aristos Queue @ Mar 28 2007, 10:30 PM)

    So I asked Jeff K (father of LV, deep knowledge of diagram optimization). He says that we can indeed constant-fold a While Loop with a constant wired to the Stop terminal. It's the only time we can constant fold the contents of a while loop, but we can do it. He says that there's no advantage to using one over the other.

    Slightly off-topic but related: if you can constant-fold a single-iteration while loop, does this affect buffer allocations at tunnels into and out of those loops? I frequently pass a cluster into a single-iteration while loop, replace an element, and then pass the cluster back out again. I've started using shift registers in place of tunnels in this situation to avoid buffer allocations. Will LabVIEW optimize this for me even if I use a tunnel, because it knows the loop iterates exactly once?

  9. QUOTE(LV Punk @ Mar 27 2007, 01:04 PM)

    Flatten to string is required to transfer the data via TCP Write and TCP Read. If you're not convinced, wire any enum to TCP Write and note that you will get a broken wire ;) .

    I was simply expanding on sachsm's happy observation that enums can be easily manipulated with string functions. Its more efficient and deterministic transmission wise to flatten the enum to a string than to format as a string and send 'broccoli' when 0x0002 (2 bytes) can be used...

    Ah, my misunderstanding of what you were trying to say. I always think of enumerations fundamentally as numbers, not as strings, even though I regularly take advantage of the ease of converting between them, and I thought you were trying to say that there was some difference between flattening an enumeration to a string versus flattening its numerical equivalent.

  10. QUOTE(LV Punk @ Mar 27 2007, 06:53 AM)

    The "Flatten to String" is irrelevant here, because the type information (the names of the enumeration items) is available on the receiving side when you unflatten, through the enumeration constant. In fact, the type information isn't even included in the string. Put a probe on the output from "Flatten to String" and you'll see this; if you're not convinced, convert the enumeration to a U16 and note that you get the same result.

  11. QUOTE(ned @ Jan 25 2007, 01:44 PM)

    I no longer have this problem. I'm not certain if the fix was the change in the network drive or something else, as I don't remember exactly when I stopped seeing the error.

    I just started suffering from this problem again :( . As far as I know our IT department didn't change anything, but I did just install the FPGA toolkit and RIO module. Do you use these toolkits? I wonder if there's a connection.

  12. QUOTE(EJW @ Feb 20 2007, 09:25 AM)

    The vi looks like it does one channel ok, but how about all 16 channels? (Unless I am not following the .vi correctly) I would think this would be kind of messy even if most of that code was in a FOR LOOP to process each channel. The time it would take to process the loop 16 times may make an impact on performance.

    This handles multiple channels just fine. The reason for converting to a 1-D array is that "Split Array" only works on 1-D arrays, and I use that to split the incoming data when it "wraps around" the end of the buffer. Here's one way you could use this: let your end-of-test condition stop the while loop. Outside the while loop (after the test completes), take the value from the shift register (the entire buffer). Rotate the array based on the index value in the other shift register so that the beginning of your 5-minute period is at the beginning of the array. Reshape the array back to 16 channels and you have your 5 minutes of data.

    EDIT: Here's the algorithm. The DAQmx task is set up for continuous acquisition. DAQmx read returns an unknown number of samples. Transpose the array of samples, then reshape to a 1-D array. Subtract the current location in the buffer (the integer shift register) from the total buffer size, and split the array of new samples at that point. Normally, the first array will contain all the data, and the second array will be empty. However, if the current location in the buffer is near the end of the buffer, then we need to wrap around and write the remaining data to the beginning of the array. The new buffer location is the previous location added to the number of new samples, unless we wrote data to the beginning of the buffer, in which case the buffer location is the number of samples written to the beginning of the buffer. Try this with a 2-D array and you'll find it's harder to split the buffer in the right place.

  13. Any news from IT ????

    Here's what IT tells me they changed:

    "Before you were going to \\server03\username$ now you are going to \\server04\users\username where it's not a security issue more so a UNC Path.

    We were using: Windows Storage Server 2003 and now we are on Windows Storage Server 2003 R2"

  14. Before I report this to NI, would someone verify that this is incorrect behavior? See the attached VI and block diagram. I have a queue containing a variant. Sometimes the element in the queue has an attribute named "loop" and sometimes it doesn't. If the "loop" attribute does not exist, and the Default Value terminal is left unwired, the attribute value will be whatever it was the last time that attribute existed. If Default Value is wired to an empty variant constant (which should not be necessary, according to the documentation), then it works as expected.

    post-3989-1169665808.gif?width=400

    post-3989-1169665818.gif?width=400

    Download File:post-3989-1169665735.vi

  15. However, for "Combo box", the command sent is the same as the value, I hope to send "r 0x24ad" for "2403.33 MHz", how could I assign different commands to different values of a "Combo box".

    In C#, it's quite easy to use a event handler and with { if(combobox.text=="2403.33 MHz") comport.write("r 0x24ad");}...

    It's difficult to get the same result with LabVIEW, at least for me at this stage.

    Is there any Compare or Match function in LabVIEW to compare the current select of a Combo box?

    These things are not difficult in LabVIEW; you just need to think about them differently. In your case, I don't think you want to use a combo box. Instead, you could use a ring or an enumeration, which looks the same to the user, but has a numeric data type. Then, create a constant array of strings with the values you want to write to the COM port. Use the numeric value from the front panel control as an index into the array of strings to determine which string to send.

    post-3989-1169125935.gif?width=400

×
×
  • Create New...

Important Information

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