Recent Posts

Pages: 1 ... 8 9 [10]
91
Technical support / Re: Test Bit for greater than or Less than
« Last post by garysdickinson on January 09, 2020, 10:39:35 PM »
    Lorne,

    This is not too difficult to do in TBASIC. It is a bit more complicated do do in ladder logic.

    This is the sort of code that I would suggest:

' SetFlgs - CF to test lower 8-bits or RELAY[1] against RELAY[2]
'
N = RELAY[1] & &h00ff   ' isolate bits 0..7
L = N - 1            ' low mask (bits less than single bit in N)
H = &hff ^ (L | N)      ' high mask (bits greater than single bit in N)

if RELAY[2] & L
   SetIO LowFlg
else
   ClrIO LowFlg
endif

if RELAY[2] & H
   SetIO HighFlg
else
   ClrIO HighFlg
endif


Comments on code:
  • L is map of the bits less that the single bit set in RELAY[1]
  • N is map of the bits greater than the single bit set in RELAY[1]
  • LoFlg is a RELAY that is set when there are bits in RELAY[2] that are less than the single bit in RELAY[1]
  • HighFlg is a RELAY that is set when there are bits in RELAY[2] that are set at positions greater than the single bit in RELAY[1]
Concerns about RELAY[1]
  • This code works if there is exactly one bit set in RELAY[1] bit positions 0..7
  • This code fails miserably if there are no bits set in RELAY[1] bit positions 0..7
  • This code fails in interesting ways if there is more than one bit set in RELAY[1] bit positions 0..7
  • If there is any chance that your rules about RELAY[1] may not be held sacred, then you need to add some code to test and verify that RELAY[1] meets the rules before you get to the code that sets/clears flags.

Best Regards,

Gary Dickinson[/list]
92
Technical support / Test Bit for greater than or Less than
« Last post by Lorne Van Dusen on January 09, 2020, 02:14:01 PM »
I have RELAY[1] that uses the first 8 bits 0 to 7 and only one bit is on at any time

I have another RELAY[2] that can have one or more bits 0 to 7 on
I need to turn on a bit that only turns on if any of the bits in RELAY[2] is greater than the bit in RELAY[1]
Then I also need a different bit to turn on if any bit that is of lower value than the bit in RELAY[1] regardless if any bit that is higher than RELAY[1] is also on.
93
Technical support / Demo Program that uses the Stack
« Last post by garysdickinson on January 07, 2020, 04:57:08 PM »
I attached a simple program that uses the stack mechanism.

The code shows a method to generate a string representation of a 32-bit signed value.  My version allows you to specify a field width and will right justify the value in a column width that you specify.

The demo code is similar in behavior to the TRI Str$(n,d) function.  The TRI version pads the converted value with leading zeros which are not very useful for my purposes.

The demo code is just that.  If I really want to right justify a 32-bit integer value in a fixed-width column I use code like this:

a$ = Str$(n) : a$ = mid$("                  ",1,d-len(a$)) + a$


I apologize for the fact that this code is 100% unreadable, it's just the best you can do in TBASIC.
 
Best regards,

Gary Dickinson
94
Technical support / Re: Implementation mentation of a Stack or LIFO in TBASIC
« Last post by garysdickinson on January 06, 2020, 03:32:09 PM »
Documentation for Stack.PC6
95
Technical support / Implementation of a Stack or LIFO in TBASIC
« Last post by garysdickinson on January 06, 2020, 03:31:35 PM »
This post shows how to implement a stack or Last In First Out data structure in TBASIC.

This example builds the stack in DM32[]. 
The size and location of the stack is controlled by entries in the #Define table.
Separate custom functions to initialize, push data and pop data are written to be as small and fast as possible.

The Stack.PC6 file is attached to this post. This is test bed code that will run in the i-TRiLOGI  simulator. This code should be easily adaptable for many uses.

The next post will have post a bit of documentation on how the stack operates.

Best regards,

Gary Dickinson
96
Technical support / Re: MT8050i to a FMD88-10 missing file called TRI_FX.si ?
« Last post by mikmet on January 02, 2020, 08:28:04 AM »
Got it from KEP!
97
Technical support / MT8050i to a FMD88-10 missing file called TRI_FX.si ?
« Last post by mikmet on January 02, 2020, 07:25:14 AM »
I'm having some trouble here connecting a MT8050i to a FMD88-10 with a CABLE-6050 via RS-232 on a prototype system.
I can connect to both units with ethernet.  I can download to both.  PLC is running program and is also talking to LCD. 
I installed the drivers and have the TRI_FX loaded local, so everything looks good.
I do get an error on the download to HMI about a file called TRI_FX.si
It appears I am missing this file from local drive, and it it not in the driver package that I downloaded from TRI in a zip file.
Does anyone have this file?
98
Technical support / Re: Custom Function Editing Window Issue
« Last post by DW_Microsys on December 17, 2019, 07:14:24 AM »
With DP cable, it works better, but still has massed up screen.
The card you tested is GTX, not RTX; and GTX is q quite old graphic card.
I have another laptop with GTX1060, it works smoothly never give an issue.
So there must be something between card driver and the java version you use.

99
Technical support / Re: Custom Function Editing Window Issue
« Last post by support on December 14, 2019, 01:34:29 PM »
The following links is a screen capture of an external 4K monitor connected to a 4K screen laptop with a GTX960M graphic card. Connection was via a HDMI cable.

https://www.triplc.com/smf/attachments/20191214/external4Kscreenshot.jpg

The i-TRiLOGI runs properly on either 4K monitors. We have tried different settings and font sizes on i-TRiLOGI and also mouse-over the buttons (see popup tooltip) but the function panels was never messed up like on your screen shot. 

Question - what display scaling did you use on your 4K monitor? We were using 125% and 100% scaling without any issue. Can you try with 100% scaling and see if it works for you?


100
Technical support / Re: Custom Function Editing Window Issue
« Last post by DW_Microsys on December 14, 2019, 01:07:13 PM »
More update:
My laptop has both HDMI port and mini Display Port.
I purchased a high quality DP-HDMI cable and connect to 4k Samsung TV.
So far it works without issue for about 3 hours.
I will post some update tomorrow or Monday.
When you test 4k monitor, did you test via HDMI, or DP?
Strange.
Pages: 1 ... 8 9 [10]