Jump to content

delbertson

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

delbertson's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Yeah but I'd like to set up the one VI to write the cluster to the file and determine the Data type at run time, the example posted is a trivial one to test my ideas out. In my final application it's likely to be 20->30 variables that's likely to change frequently during development. Hoped I'd be able to use Variant to Flattened String then use the data type String in a case statement to define the data type but I couldn't get that working either. I'm off to look at the variantconfig package, thanks to both of you for replying Derek
  2. I am trying to put together a VI's 'state so it can be re-loaded. I was hoping to pass in only a cluster and have the config file use the name of the Cluster as the section then in that section have each element of the cluster as a key in that section i.e. [Cluster1] Span=50 Speed=20 Home=TRUE Enable=FALSE Carrier Size=127 [Cluster2] Span=10 Speed=100 Home=FALSE Enable=FALSE Carrier Size=127 This is what I've come up with... but I get the following error "These cannot be wired together because their data types (numeric, string, array, cluster, etc.) do not match. Show the Context Help window to see what data type is required. The type of the source is Variant. The type of the sink is boolean (TRUE or FALSE).can't get the value out right." The write.value input is set as Automatic Any comments or suggestions would be appreciated Derek
  3. Hi I'm currently trying to interface with a Can bus driver dll. I have used the DLL succesfully with C# but I'm having a problem in Labview that I just can't catch. I've interfaced a number of the functions using the 'Call Library Function' Block' without a problem, but it all goes wrong for me when I try and input a Cluster to one of the functions i.e.... C# // CAN message [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct TPCANMsg { public uint ID; // 11/29 bit identifier public byte MSGTYPE; // Bits from MSGTYPE_* public byte LEN; // Data Length Code of the Msg (0..8) [ MarshalAs( UnmanagedType.ByValArray, SizeConst = 8 )] public byte[] DATA ; //Data 0 .. 7 } /////////////////////////////////////////////////////////////////////////////// // Write() // This function Place a CAN message into the Transmit Queue of the CAN Hardware // // Possible Errors: NOVXD RESOURCE BUSOFF QXMTFULL // [DllImport("PCAN_USB.dll", EntryPoint="CAN_Write")] public static extern uint Write(ref TPCANMsg msg); So In labView.... So I've created a Cluster with a U16(ID), U8 (MSGTYPE),U8(LEND) and an Array of 8 U8s (DATA), I then connect that to the DLL using a 'Call Library Function' block, it all runs ok except the Data part on the Can bus doesn't seem to be getting passed correctly and is doesn't change. The Help says a cluster will get passed as a referance so that looks right. I have my 'Call Library Function' configured to handle the cluster as 'Adapt to Type' and 'Handles by Value'. Any help on this would be appreciated. Derek
  4. Hi Everyone, Sorry for going quiet on this subject but myself and Baptie were away at NI last week doing our Basic 1 and 2 Course and now Baptie is on holiday for a few days. When he returns we'll be sitting down and looking at our over all VI architectures armed with our new knowledge and your comments. We'll keep you posted as our 'plan' developes. Thanks again to all who have taken time to offer there advice. Del
  5. Yeah... I guess that makes sense. Thanks everyone for the help it's appreciated
  6. Managed to get that working :thumbup: Couldn't work out how to add a notifier out though. Ended up adding the control to the main VI then turned the section into a VI to create the interface. Is there a more direct way of doing this? Thanks again Derek
  7. Thanks guys... not really understood your reply's, as I said I'm a newbie from a C background... but you've both gave me some stuff to try so I should be able to work out it from here (famous last words) Thank you both very much for your reply, I will let you know how I get on. All the best Derek
  8. Hi I'm just new to Labview and have a bit of a newbie question. I have set up and Tested a VI to control a motor via the CAN_Open protocol, and it's working fine. It's currently in a timed while loop. It has a Dial control for speed a latch button for on/off and a radio button to select it's direction of rotation. I'm my final application I'll require 3 of these motors with exactly the same controls though the Max and min speeds will be different, as will it's coms ID. I'd like to be able to just include this VI, pass it the Max and Min values etc and replicate it on my front panel and use it like a user control. If I hide all the controls used as I/O to the VI leaving only the user controls, and make the VI reentrant.... I can get more than one instance of my VI to run in separate windows... but I'd prefer to have them on a single user interface. Is this possible and if so could any of you Labview experts point me in the right direction or to a url with an example of this type of thing? Thanks in Advance. Derek
×
×
  • Create New...

Important Information

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