Jump to content

Thang Nguyen

Members
  • Posts

    299
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Thang Nguyen

  1. Hi,

    I am working on a project which I build a plant model in Matlab/Simscape and control this plant from Simulation Interface Toolkit (SIT). The issue I am having right now is timing. Time in LabVIEW is faster than in Simulink. So if I open a valve for a duration of time in LabVIEW, it will happens faster than it should be in Simulink. I tried to get the time in Simulink and used that as the time to measure the duration and now it slower than it should be.

    Do you have any experience with this? Could you please give me some recommendation for this issue?

    Thank you so much for your time!

    Best regards,

    Thang Nguyen

  2. Hi,

    I am working on a project which required integrating LabVIEW Simulation Interface Toolkit (SIT) with MatLab Simscape Simulink. I got some issues and need any comment to solve theses.

    1. Invalid Mapping: This case is weird. I use a numeric indicator to map to a output of a physical signal sensor after converting physical signal to simulink signal. It uses to work well before and one day it stops working. And I have no clues why this happens.

    2. Solver restriction: To be able to integrate with LabVIEW, I have to use a fixed step solver in Matlab. This is confirmed by an application engineer from NI customer service. And this limit a lot of performance of Matlab. I don't have much knowledge about Matlab so if there is any have any experience about this, please let me know is there any good practice about this issue.

    Best regards,

    Thang

  3. Hi,

    I have an array of clusters. There are multiple of types of control inside these clusters (number, string, enum, boolean). If I use event structure, I can manage to find out which cluster changes and which control changes but I cannot get the actual value of that cluster. I don't know how to get the reference of the cluster.

    Could you please give me a hint?

    This is the part of my code:

    Best regards,

    Thang Nguyen

    post-7703-127318050282_thumb.jpg

  4. Hi,

    I am trying to detect the Header Start Byte in a string of data sent though TCP/IP by myself. The string of data is built by concatenate the string converted from array of byte data. When I receive it, I just do in the reverse order. And the match pattern function doesn't work. But if I convert the string to array of byte, I can search it. I post this becaue I want to understand what I did wrong.

    Thank you,

    Thang Nguyen

    I have my code here:

    TestScanString.vi

    post-7703-127238746736_thumb.jpg

  5. Hi,

    I have just run into a case which I don't quite understand. In my program I created multi thread. Each thread will have each own data queue base on the name of the thread (ex: client 0 queue, client 1 queue, ..). The programs let you be able to remove the last thread and recreate a new thread with the same name for example delete client 1 and recreate client 1. So the program will recreate a thread named client 1 with a data queue named "client 1 queue". When I remove a thread, I always release the data queue of that thread.

    The issue happens when I recreate the queue, I cannot enqueue, it will have time out, and the queue doesn't work. So I played around with it and finally I tried with flush queue; and it works. Is this a problem with LabVIEW queue? should I flush it before I release a queue or should LabVIEW handle this job? Somehow the memory for the queue is not release if I don't use flush queue. It's just a guess. Hope to receive your idea.

    Maybe I will not ask this question because long time ago I always flush queue before release it. This is kind of following what I had learned. Then when I posted a question about queue on Lavag, there was someone asked me why I had to do like that, just release the queue. Now this issue comes up frusty.gif .

    Best regards,

    Thang Nguyen

    Hi,

    I have to add some information, I tried to flush the queue before release the queue, but it doesn't work. It works when I flush the queue after recreating it. Still not understand why. Please give me your idea.

  6. Hi,

    There is one thing I still not figure out is how I can send data to other clients? I belive that I cannot have the reference of other clients in one client. Inside the process of one client there should be 2 independent loops. One is to receive data, and one is to send data. Could you please tell me how I send data to the rest of client?

    Best regards,

    Thang Nguyen.

  7. Hi,

    I am working on a project with cRIO. My VI runs in FPGA.

    What I do in PC is calculate the frequency then convert it to period and convert to uSec (multiply by 1,000,000). This value is sent to FPGA by the FPGA interface.

    In FPGA, I just do as in the screenshot.

    I still have some different in the value. The value I calculate is 60.4 Hz and the signal I received from the scop is 60.2 Hz. I just wonder if I can make it better. This lead to a different of 0.1 mph or 5 r/min depend on signal.

    I highly appreciate any help.

    Best regards,

    Thang Nguyen

    post-7703-125979158706_thumb.jpg

  8. Hi,

    In my VI, I use a Gauge control with a digital display so user can either move the needle or input the value in digital display. In my VI I use an event structure to get the update value.

    If I use the value changed event, when I move the needle it will generate the event continously. I don't want this happen, I just want the latest value.

    So I tried to use the mouse up event, then it didn't generate the event if I update the digital display.

    I have an idea with using a seperate numeric control for digital display and have 2 event seperately. But I think this is a costly solution. Is there any simpler way to solve this?

    Best regards,

    Thang Nguyen

  9. Thank Mark,

    I guess I should do this for all of the channels connect to the server.

    I just want to confirm that if this is a really good architecture for a server because this is a CAN server workin on a 1Mb rate network with unknow number of real controllers as well as simulator controllers.

    In my server, I need to read messages from all of the channels connected to the server. Then I need to broadcast these messages to all of the channels beside the one they are come from.

    Best regards,

    Thang Nguyen

  10. Hi,

    I have never met this case and don't how to fix it.

    I have a ring control with a list of item but none of them have value 0.

    I did initialize the control by assigning a constant value for that control, but it displays [ <0> ] not the item in the list. Then I have to click on the control and select another value it will update to the new one.

    Could you please tell me why and how to fix it?

    Best regards,

    Thang Nguyen

  11. Hi,

    I am working on writing the frequency pulse signal using digital output with correlated clock in CompactDAQ device. I found some examples about this already, But there is onething I don't understand is before start writing the signal out continuously, I have to define a pattern for my signal by writing an array of data to the DAQmx write. I don't understand about this. How to define the frequency and how to define the duty cycle? Could you please help me?

    Best regards,

    Thang Nguyen

  12. I did go one step further by put the Simulator.exe run on another computer in the network. I call this PC B. And from my computer, PC A, I try to access to the Simulator.exe on PC B. But I get this error:

    Error 66 occurred at Open Application Reference in Get Control refs in exe.vi

    Possible reason(s):

    LabVIEW: The network connection was closed by the peer. If you are using the Open VI Reference function on a remote VI Server connection, verify that the machine is allowed access by selecting Tools>>Options>>VI Server:Machine Access on the server side.

    =================

    On PC A:

    I changed the localhost string input in the open application vi by the domain name of the PC B.

    On PC B:

    What I have done so far is on PC B, I do these settings:

    VI Server: Configuration

    + Check TCP/IP

    + Port: 3364

    VI Server: Machine Access

    + Add my computer domain to the Machine access list. I also add * to this list.

    VI Server: User Access

    + Leave blank. I expect this will allow the PC list in the machine access list to be able to access

    VI Server: Exported VIs

    + Add the name of the vi: Simulator.vi. I also add * to the list.

    Do you have any idea if I miss anything?

    Best regards,

    Thang Nguyen

  13. Thank,

    I am sorry I cannot open your vi because I only have 8.6.1. Could you please save it down to one version for me? Thank you for that.

    I am trying to work with a simple example.

    I have a Sim project which includes Simulator.vi which is built become Simulator.exe. I have another Test project which includes Test.vi. I would like from Test.vi be able access to the controls on the front panel of the Simulator.exe. I attach here what I have done so far. Please rebuild the Sim source first.

    I got an error message with my current Test.vi:

    Error 7 occurred at Open VI Reference in Test.vi

    Possible reason(s):

    LabVIEW: File not found. The file might have been moved or deleted, or the file path might be incorrectly formatted for the operating system. For example, use \ as path separators on Windows, : on Mac OS, and / on Linux. Verify that the path is correct using the command prompt or file explorer.

    =========================

    NI-488: Nonexistent GPIB interface.

    VI Path: C:\My Projects\My New Projects\AutomatedTest\Sim Build\Simulator.exe\Simulator.vi

    Sim Source.zip

    Test Source.zip

×
×
  • Create New...

Important Information

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